Crates.io | caesar_cipher_enc_dec |
lib.rs | caesar_cipher_enc_dec |
version | 0.6.2 |
source | src |
created_at | 2023-09-05 13:20:06.853775 |
updated_at | 2024-03-27 15:15:24.606789 |
description | can easily use caesar cipher |
homepage | |
repository | |
max_upload_size | |
id | 964275 |
size | 3,870 |
can easily use caesar_encrypt and decrypt. set text and shift number
use caesar_cipher_enc_dec::caesar_cipher::caesar_encrypt;
fn main(){
let text = "I LOVE YOU";
let enc_text = encrypt(&text, 3);
let dec_text = encrypt(&enc_text, -3);
let dec_text2 = decrypt(&enc_text, 3);
}
you can use this encrypt code for decrypt.
use crate::caesar_cipher_enc_dec::caesar_cipher::caesar_encrypt;
let text = "L ORYH BRX.";
for i in 0..26{
let mut result = encrypt(&text, i)}
println!("{}", result);