From 90c5827e68d1a874802513efc45dc913d50a5607 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Thu, 8 Jun 2017 15:16:14 +0300 Subject: AES256 -> AES128 With recent `cryptonite` I was getting the `CryptoError_KeySizeInvalid` exception. Probably, related to https://github.com/haskell-crypto/cryptonite/commit/f5efdee75b44051bc94cb4714f310609e021093a where key size validation was added. --- src/Web/ZeroBin/SJCL.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Web/ZeroBin/SJCL.hs b/src/Web/ZeroBin/SJCL.hs index 60e8737..a27ecb7 100644 --- a/src/Web/ZeroBin/SJCL.hs +++ b/src/Web/ZeroBin/SJCL.hs @@ -14,7 +14,7 @@ module Web.ZeroBin.SJCL ( encrypt ) where -import Crypto.Cipher.AES (AES256) +import Crypto.Cipher.AES (AES128) import Crypto.Cipher.Types (ivAdd, blockSize, cipherInit, ecbEncrypt, ctrCombine, makeIV) import Crypto.Error (throwCryptoErrorIO) import Crypto.Hash.Algorithms (SHA256(..)) @@ -43,7 +43,7 @@ data Content = Content { instance JSON.ToJSON Content where toJSON = JSON.genericToJSON JSON.defaultOptions -makeCipher :: ByteString -> IO AES256 +makeCipher :: ByteString -> IO AES128 makeCipher = throwCryptoErrorIO . cipherInit -- https://github.com/bitwiseshiftleft/sjcl/blob/master/core/pbkdf2.js -- cgit v1.2.3