package ixee.cryptopals.solvers import scala.io.Source import ixee.cryptopals.utils.ByteUtils._ import ixee.cryptopals.utils.CryptoUtils._ import ixee.cryptopals.utils.StreamUtils._ import ixee.cryptopals.utils.ConversionUtils._ import ixee.cryptopals.utils.FunctionUtils._ import ixee.cryptopals.utils._ import ixee.cryptopals.utils.crypto._ import io.github.marklister.base64.Base64._ object Challenge10 { val path = "./data/10.txt" lazy val ciphertext = Source .fromFile(path) .getLines() .toSeq .mkString .toByteArray def run = { def builder = SchemeBuilder("AES", "YELLOW SUBMARINE".asBytes) .cbc(Stream.continually(0.toByte).take(16)) new String(cbcDecrypt(builder)(ciphertext).toArray) } }