[erlang-questions] aes-128-cbc decryption in erlang

Kenji Rikitake kenji.rikitake@REDACTED
Sat Feb 20 00:21:02 CET 2010


The first value of IV must be given before the decryption starts.  The
man entry of "openssl enc" says the first IV will be given from the
password. See the -iv option of OpenSSL. 

And the aes_cbc_ivec usage example is available in
lib/ssh/src/ssh_transport.erl

Regards,
Kenji Rikitake

In the message <be8f531d1002190823r756d6614w4348bf18f528129f@REDACTED>
dated Fri, Feb 19, 2010 at 10:22:36PM +0600,
Maxim Treskin <zerthurd@REDACTED> writes:
> What is erlang crypto analog of following comand?
> 
> openssl enc -d -aes-128-cbc -pass env:KEY -in file.ssl -out file.txt
> 
> There is function aes_cbc_128_decrypt which takes Key, IVec and
> encoded data, but how I can get an IVec?
> crypto:aes_cbc_ivec returns some IVec, but when it passed to
> aes_cbc_128_decrypt I have wrong output of decoded data. May be I
> doing something wrong?


More information about the erlang-questions mailing list