First half of set 2

This commit is contained in:
2023-04-27 20:19:27 -07:00
parent ea25f818e5
commit 5a4924ab99
13 changed files with 410 additions and 14 deletions

View File

@ -1,17 +1,13 @@
use cryptopals::bvecs;
use cryptopals::friendly::likely_ecb;
use cryptopals::prelude::*;
fn main() {
let inputs = bvecs!("inputs.txt");
for input in inputs {
'seek: for ix_0 in (0..input.len()).step_by(16) {
for ix_1 in (ix_0+16..input.len()).step_by(16) {
if input[ix_0..ix_0+16]==input[ix_1..ix_1+16] {
println!("possible ECB: {}", input.to_hex());
break 'seek
}
}
if likely_ecb(&input) {
println!("possible ECB: {}", input.to_hex());
}
}
}