[pycrypto] PyCrypto & OpenSSL

David Arena arenstar at gmail.com
Sat Mar 19 14:38:57 CST 2011


I am having trouble decrypting in OpenSSL from a ciphertext encrypted in PyCrypto..

Let me explain what im doing first..
using Aes-128-cbc..

key          = '0123456789abcdef'             eg. 30313233343536373839414243444546 ( represented here in hex )
plaintext = uuid ( 128bit without the "-") eg. ffc60acb3cf14fd999cb3dff91a62091
iv		= urandom(16)			      eg. c4b366c68cd086b4197dc1f6bd3f95f4 (represented here in hex for clarity)

on Encryption in pycrypto

i encrypt in pycrypto.. and append the plaintext iv to the ciphertext
ciphertext will now equal plaintextIV+ciphertext

on Decryption in pycrypto
iv = zeros

and everything works as i assumed..

This follows what i understood the pgp approach using CBF..


If i try to decrypt in Openssl using this type statement.

echo $ciphertext | openssl aes-128-cbc -K 30313233343536373839414243444546 -iv 30303030303030303030303030303030 -p -nosalt -nopad

it is not functioning, or returning my uuid :(

Can anyone help me?
Or even tell me how stupid i am :D


More information about the pycrypto mailing list