You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
There isn't sadly; it would be nice to start collecting some small example like this. @nrolland: care to write one maybe ? I'm happy to guide you to write the right thing.
It should roughly looks like in pseudo code:
importqualifiedData.ByteString.LazyasLimportCrypto.ErrorimportCrypto.Cipher
encrypt key in out =dolet cipher = (throwCryptoError $ cipherInit key) ::AES128
inData <-L.readFilein
iv <- makeIV <$> getRandom 16let outData = loop cipher iv inData
L.writeFile out (L.fromChunks outData)
where loop cipher iv l =let (a,b) =L.splitAt1024 l
inifL.empty b
then cbcEncrypt cipher iv (applyPadding b)
elselet out = cbcEncrypt cipher iv (L.toStrict a)
nextIv = makeIV $ takeLast 16 out
in out : loop cipher nextIv b
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hi,
is there a simple example somewhere to do some file level CBC encryption ?
thank you !
The text was updated successfully, but these errors were encountered: