Key Agreement generate a 32 bytes key instead of 16 bytes key (AES cipher)
 843811Jan 14 2009 — edited Jan 15 2009
843811Jan 14 2009 — edited Jan 15 2009Java 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?