Start with challenge 18.

This commit is contained in:
2022-07-09 11:33:00 -04:00
parent 29c2685b1a
commit 1304ff2144
4 changed files with 48 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
use crate::bytes::Bytes;
use crate::bytes_base64::BytesBase64;
use crate::cbc;
use crate::ctr;
use rand::Rng;
use std::io::{BufRead, BufReader};
@@ -95,5 +96,11 @@ pub fn challenge17() {
}
pub fn challenge18() {
println!("[xxxx] Challenge 18: ");
let key = Bytes::from_utf8("YELLOW SUBMARINE");
let cipher = BytesBase64::from_base64(
"L77na/nrFsKvynd6HzOoG7GHTLXsTVu9qvY/2syLXzhPweyyMTJULu/6/kXX0KSvoOLSFQ==",
)
.to_bytes();
let cleartext = ctr::decrypt(&key, &cipher).to_utf8();
println!("[xxxx] Challenge 18: {cleartext}");
}