evp_decrypt(+CipherText,
+Algorithm, +Key, +IV, -PlainText, +Options)
- aes-128-cbc
- aes-256-cbc
- des3
If the IV is not needed for your decryption algorithm (such as aes-128-ecb) then any string can be provided as it will be ignored by the underlying implementation
Options:
- encoding(+Encoding)
- Encoding to use for Data. Default is
utf8. Alternatives areutf8andoctet. - padding(+PaddingScheme)
- Padding scheme to use. Default is
block. You can disable padding by supplyingnonehere.
Example of aes-128-cbc encryption:
?- evp_encrypt("this is some input", 'aes-128-cbc', "sixteenbyteofkey",
"sixteenbytesofiv", CipherText, []),
evp_decrypt(CipherText, 'aes-128-cbc',
"sixteenbyteofkey", "sixteenbytesofiv",
RecoveredText, []).
CipherText = <binary string>
RecoveredText = "this is some input".