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!

Key Agreement generate a 32 bytes key instead of 16 bytes key (AES cipher)

843811Jan 14 2009 — edited Jan 15 2009
Java sample code extracted from: Java ™ Cryptography Architecture (JCA) Reference Guide for JavaTM Platform Standard Edition 6

From Appendix D: Sample Programs, Diffie-Hellman Key Exchange between 2 Parties.

I try to change the DES cipher to a AES cipher. When getting the SecretKey using keyAgree.generateSecret("AES") I always receiving a 32 bytes key.
I need a 16 bytes key since 32 bytes is illegal by default.

Any Ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2009
Added on Jan 14 2009
5 comments
527 views