Trouble encrypting correctly with AES with a static key
posted 8 years ago
Hi. I'm trying to get JCE to work with the following example using AES in ECB mode (yes, ECB shouldn't be used, but it's what I'm supposed to use): given a clear text String represented by the bytes (in hex) 546578746F2070617261207465737465 and a key 6573736173656E686165686672616361, the program is supposed to provide the encrypted bytes A506A19333F306AC2C62CBE931963AE7. I used an online encryption service to check for myself if the above is true, and it is. However, I just can't get it to work right in Java:
All examples I found generate a key instead of using a static one. Well, I need to use that specific key.
What am I doing wrong? Thank you very much!
[ June 04, 2007: Message edited by: Bernardo Luz ] [ June 07, 2007: Message edited by: Bernardo Luz ]