Error in AES?
Nils Müllner
nils.muellner@REDACTED
Tue Mar 21 14:29:49 CET 2006
hi,
i was using aes and after i encrypted the word blubb i tried to decrypt
it with my key and vector. but i could'nt get my old values back. is
this error due to open-ssl or crypto 1.4?
kind regards
nils muellner
Erlang (BEAM) emulator version 5.4.10 [threads:0]
Eshell V5.4.10 (abort with ^G)
1> crypto:start().
ok
2> Key =
<<16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#FF,16#00,16#00>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0>>
3> IVec =
<<16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>
4> Text = "blubb".
"blubb"
5> EnCipher = crypto:aes_cbc_128_encrypt(Key, IVec, Text).
<<219,85,61,9,98>>
6> <<"blubb">> == crypto:aes_cbc_128_decrypt(Key, IVec, EnCipher).
false
7> DeCipher = crypto:aes_cbc_128_decrypt(Key, IVec, EnCipher).
<<171,161,9,165,75>>
8> EnCipher2 = crypto:aes_cbc_128_encrypt(Key, IVec, DeCipher).
<<69,151,237,186,126>>
9> DeCipher2 = crypto:aes_cbc_128_decrypt(Key, IVec, EnCipher2).
<<51,198,63,10,1>>
More information about the erlang-questions
mailing list