2023-04-27 04:58:19 +00:00
|
|
|
#![feature(array_chunks)]
|
2023-04-28 01:38:36 +00:00
|
|
|
use cryptopals::{prelude::*, bvec64, friendly::aes128};
|
2023-04-27 04:58:19 +00:00
|
|
|
|
|
|
|
fn main() {
|
2023-04-28 01:37:59 +00:00
|
|
|
let key = *b"YELLOW SUBMARINE";
|
2023-04-27 04:58:19 +00:00
|
|
|
|
|
|
|
let input = bvec64!("input.txt");
|
|
|
|
let mut output = Vec::new();
|
|
|
|
for chunk in input.array_chunks::<16>() {
|
2023-04-28 01:37:59 +00:00
|
|
|
output.extend(aes128::decrypt(key, *chunk));
|
2023-04-27 04:58:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dbg!(output.to_text().unwrap());
|
|
|
|
println!("pass")
|
|
|
|
}
|