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 update() problem

843811Sep 13 2010 — edited Sep 17 2010
Hello,
I am using encryption with AES and CFB with no padding, to encrypt messages i have to send throw a socket connection.
I am using a Cipher object to encrypt and decrypt. When i encrypt a message, i use the update() method. The problem now is that if the message that i need to encrypt is smaller than the block size (in my case 16 bytes), the method update() return an empty array. To solve this i use the doFinal() method, but i can't do that because the other side of the socket is already implemented and force me to do it with update().

My question is: Is there any way to use update() and if the size is small it returns the array anyway?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2010
Added on Sep 13 2010
21 comments
604 views