First half of set 2
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user