Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AES-256, BouncyCastle, Sun Crypto Providers, Default Padding

843811Feb 8 2010 — edited Feb 8 2010
Hi,

The subject alsmost says it all, but in a nutshell, I would like to use BC for AES-256. I also wanted to compare the ciphered outputs from both BC and SUN to make sure everything was working ok (I have installed the Unlimited Strength Jurisdiction Policy Files 6 for the Sun JRE 6).

I have noticed the following, when the data input is a multiple of 16, the ciphered data generated by both engines are the same (Sun = AES, BC = PaddedBufferedBlockCipher(AES Engine) + PKCS7Padding).

However, when the data input is not of a multiple of 16 - the ciphered output is different.

Hence my question: What is the default padding and mode used by the Sun JCE when doing a getInstance("AES") ?
How to make sure that the ciphered data is the same for both engines, regardless of the data input length pls?

Thx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2010
Added on Feb 8 2010
9 comments
1,116 views