diff options
Diffstat (limited to 'tests/lib.rs')
-rw-r--r-- | tests/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs index 231be41..80342e3 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -37,3 +37,11 @@ fn problem_4 () { .collect::<Vec<Vec<u8>>>(); assert_eq!(matasano::find_single_byte_xor_encrypted_string(&possibles[..]), b"nOW\0THAT\0THE\0PARTY\0IS\0JUMPING*"); } + +#[test] +fn problem_5 () { + let plaintext = b"Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal"; + let key = b"ICE"; + let ciphertext = "0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272a282b2f20430a652e2c652a3124333a653e2b2027630c692b20283165286326302e27282f".from_hex().unwrap(); + assert_eq!(matasano::repeating_key_xor(plaintext, key), ciphertext); +} |