summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2014-11-23 02:35:03 -0800
committeriximeow <me@iximeow.net>2014-11-23 02:35:03 -0800
commitc72d2427805e6a764eae1e1d40643a410a9181ae (patch)
treeeb104ec133a69c3c253673727cf84256b68f833a
parent8a0354348d1f022908eaeecc162ea4aeb24ba910 (diff)
Add spec for challenge 3
-rw-r--r--test/Set1Spec.scala11
1 files changed, 10 insertions, 1 deletions
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
+ }
}
}