diff options
author | iximeow <me@iximeow.net> | 2014-11-28 03:15:21 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2014-11-28 03:15:21 -0800 |
commit | 409e8109d8076058e4f154272270a79b6844da18 (patch) | |
tree | b98297162d542506bd4eb911532b349608dfc2d7 /src/utils/CryptoUtils.scala | |
parent | 0af5a2e4ade0b032e1ec6d25c51de2ff95dd2799 (diff) |
Refactor CBC utils
Diffstat (limited to 'src/utils/CryptoUtils.scala')
-rw-r--r-- | src/utils/CryptoUtils.scala | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/utils/CryptoUtils.scala b/src/utils/CryptoUtils.scala index 430934b..6c2849e 100644 --- a/src/utils/CryptoUtils.scala +++ b/src/utils/CryptoUtils.scala @@ -11,17 +11,4 @@ object CryptoUtils { s ++ Stream.continually(padLength.toByte).take(padLength) } - def cbcDecryptInstance(cipherPrim: String, key: Seq[Byte], iv: Seq[Byte]): CBCDecrypter = { - val keySpec = new SecretKeySpec(key.toArray, cipherPrim) - val cipher = Cipher.getInstance(s"$cipherPrim/ECB/NoPadding") - cipher.init(Cipher.DECRYPT_MODE, keySpec) - new CBCDecrypter(cipher, iv) - } - - def cbcEncryptInstance(cipherPrim: String, key: Seq[Byte], iv: Seq[Byte]): CBCEncrypter = { - val keySpec = new SecretKeySpec(key.toArray, cipherPrim) - val cipher = Cipher.getInstance(s"$cipherPrim/ECB/NoPadding") - cipher.init(Cipher.ENCRYPT_MODE, keySpec) - new CBCEncrypter(cipher, iv) - } } |