migrating from bsafe to openSSL

2009-04-01 Thread m r
I'm looking to migrate AES encryption code from BSAFE to openSSL. As a test, I encrypted a string using BSAFE AES tried to decrypt using AES of openSSL. The openSSL manages to decrypt, but it adds some junk (mostly unprintable characters) in the end. For example, if my input is 1234, the

Re: migrating from bsafe to openSSL

2009-04-01 Thread Dr. Stephen Henson
On Wed, Apr 01, 2009, m r wrote: I'm looking to migrate AES encryption code from BSAFE to openSSL. As a test, I encrypted a string using BSAFE AES tried to decrypt using AES of openSSL. The openSSL manages to decrypt, but it adds some junk (mostly unprintable characters) in the end. For

Re: migrating from bsafe to openSSL

2009-04-01 Thread Kyle Hamilton
The 'junk' on the end is PKCS padding. Since AES is a block cipher, it needs to operate on multiples of the block size (16 bytes, or 128 bits). PKCS padding specifies that the final set of bytes are each set to the number of bytes of padding -- in the 0c case, that's 12 bytes of padding;

Re: migrating from bsafe to openSSL

2009-04-01 Thread m r
Thanks for your help. I appreciate the prompt response. On Wed, Apr 1, 2009 at 3:27 PM, Dr. Stephen Henson st...@openssl.orgwrote: On Wed, Apr 01, 2009, m r wrote: I'm looking to migrate AES encryption code from BSAFE to openSSL. As a test, I encrypted a string using BSAFE AES tried to