+ let encrypted_mess_encoded = url::percent_encoding::utf8_percent_encode(&encrypted_mess, url::percent_encoding::DEFAULT_ENCODE_SET).to_string();
+ println!("Encrypted message percent-encoded: {}", encrypted_mess_encoded);
+ }
+ None => print_usage()
+ }
+
+ return Ok(());
+ } else if let Some((position_arg_decrypt, _)) = args.iter().find_position(|arg| arg == &"--decrypt") {
+ match args.iter().nth(position_arg_decrypt + 1) {
+ Some(cipher_text) => {
+ let cipher_text_decoded = url::percent_encoding::percent_decode(cipher_text.as_bytes()).decode_utf8().expect("Unable to decode encoded cipher text");
+ let plain_text = crypto::decrypt(&key, &cipher_text_decoded).unwrap();
+ println!("Decrypted message: {}", plain_text);