indeed a very simple solution for AES!<br><br>On Friday, August 24, 2012 3:00:06 PM UTC+2, Nils Schweinsberg wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Am 24.08.2012 14:47, schrieb marcmo:
<br>> * AES Encryption/Decryption (CBC-Mode)
<br>
<br>For AES there is the "SimpleAES" package[1] which is super easy to use:
<br>
<br>> import qualified Data.ByteString as BS
<br>> import Data.ByteString.Lazy as BL
<br>>
<br>> import Codec.Crypto.SimpleAES
<br>>
<br>> key :: IO Key
<br>> key = BS.readFile "key"
<br>>
<br>> encrypt :: ByteString -> IO ByteString
<br>> encrypt bs = do
<br>> k <- key
<br>> encryptMsg CBC k bs
<br>>
<br>> decrypt :: ByteString -> IO ByteString
<br>> decrypt bs = do
<br>> k <- key
<br>> return $ decryptMsg CBC k bs
<br>
<br>(note that the key is a strict ByteString while the encrypted/decrypted
<br>data is lazy)
<br>
<br>[1]: <a href="http://hackage.haskell.org/package/SimpleAES" target="_blank" data-bitly-type="bitly_hover_card">http://hackage.haskell.org/<wbr>package/SimpleAES</a>
<br>
<br>______________________________<wbr>_________________
<br>Haskell-Cafe mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="NT0AxosWdkcJ" data-bitly-type="bitly_hover_card">Haskel...@haskell.org</a>
<br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" data-bitly-type="bitly_hover_card">http://www.haskell.org/<wbr>mailman/listinfo/haskell-cafe</a>
<br></blockquote>