Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created May 13, 2011 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradclawsie/971052 to your computer and use it in GitHub Desktop.
Save bradclawsie/971052 to your computer and use it in GitHub Desktop.
minimal simpleAES example
module Main (main) where
import Codec.Crypto.SimpleAES
import Data.ByteString.Lazy as L
import Data.ByteString.Lazy.Char8 as L8
import Data.ByteString.Char8 as B8
main = do
let lstr = L.concat [L8.pack "hi there"]
pw = B8.pack "abc123abc1234567"
lencode2 <- encryptMsg CBC pw lstr
print lencode2
let ldecode2 = decryptMsg CBC pw lencode2
print ldecode2
print lstr
return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment