Hi, Rust experts!
I've written a simple library code with a submodule named utils.rs, to crack a simple Caesar Cypher (shift the letters of the alphabet by a fixed amount).
What this does is: 1. Take input text, index each letter based on its position in the alphabet, add a shift to the index, and then map the new index numbers back to their corresponding letters. This is repeated for shifts of 0 to 25. It essentially just does the busywork of trying each possible Caesar Cypher configuration.
What I need to know is how to make this code more efficient, because I get the feeling that there may be an easier/faster/more efficient way of doing things.
main.rs
use rust_crypto_tools::*;
fn main() {
attack::ceasar(String::from("hzruvadohafvbyjvbuayfjhukvmvyfvbhzrdohafvbjhukvmvyfvbyjvbuayf"),26);
}
