From c72d2427805e6a764eae1e1d40643a410a9181ae Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 23 Nov 2014 02:35:03 -0800 Subject: Add spec for challenge 3 --- test/Set1Spec.scala | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/Set1Spec.scala b/test/Set1Spec.scala index 4dbbfef..a7a8ef6 100644 --- a/test/Set1Spec.scala +++ b/test/Set1Spec.scala @@ -5,6 +5,8 @@ import com.ixee.IxeeSpec class Set1Spec extends IxeeSpec { import ixee.cryptopals.utils.ConversionUtils._ + import ixee.cryptopals.utils.ByteUtils._ + import ixee.cryptopals.solvers._ "Set1" - { @@ -26,10 +28,17 @@ class Set1Spec extends IxeeSpec { "686974207468652062756c6c277320657965" ) - (a xor b).toHexStr mustBe + (a xor b).hex mustBe "746865206b696420646f6e277420706c6179" } + "Challenge 3: single-byte xor cipher" in { + XorDecrypt.findBestSingleByteKey( + hexStr2Bytes( + "1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736" + ) + ) mustBe 88.toByte + } } } -- cgit v1.1