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>&gt; * AES Encryption/Decryption (CBC-Mode)
<br>
<br>For AES there is the "SimpleAES" package[1] which is super easy to use:
<br>
<br>&gt; import qualified Data.ByteString &nbsp; &nbsp; &nbsp;as BS
<br>&gt; import &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Data.ByteString.Lazy as BL
<br>&gt; 
<br>&gt; import Codec.Crypto.SimpleAES
<br>&gt; 
<br>&gt; key :: IO Key
<br>&gt; key = BS.readFile "key"
<br>&gt; 
<br>&gt; encrypt :: ByteString -&gt; IO ByteString
<br>&gt; encrypt bs = do
<br>&gt; &nbsp; k &lt;- key
<br>&gt; &nbsp; encryptMsg CBC k bs
<br>&gt; 
<br>&gt; decrypt :: ByteString -&gt; IO ByteString
<br>&gt; decrypt bs = do
<br>&gt; &nbsp; k &lt;- key
<br>&gt; &nbsp; 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>