1use byte_aes::Aes256Cryptor;
2
3fn main() {
4 let my_32byte_key = "Thisi$MyKeyT0Encryp!thislastTime";
5
6 let cryptor = Aes256Cryptor::try_from(my_32byte_key).unwrap();
7 let original_text = "I am Omkaram Venkatesh and
8 this is my plain text and some random chars 223@#$^$%*%^(!#@%$~@#$[]]'///\\drewe. Lets see if this gets encrypted now)".to_string();
9
10 let encrypted_bytes: Vec<u8> = cryptor.encrypt(&original_text);
11
12 let decrypted_text: String =
13 String::from_utf8_lossy(&cryptor.decrypt(encrypted_bytes).unwrap_or_default()).to_string();
14
15 assert_eq!(original_text, decrypted_text);
16}