AES update() problem
843811Sep 13 2010 — edited Sep 17 2010Hello,
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!