AES encryptAesCbc Error #44
-
encryptAesCbc func in AES occurs indexoutofboundsexception with "words" val has lengh = 5. Is this an error? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@bibinbodongti can you provide an example of usage that reproduces the problem? |
Beta Was this translation helpful? Give feedback.
-
Yeah it seems to be expected. But the error reported was a bit misleading. I have handled it here: If the number of bytes you are providing in the data are not multiple of 16, you have to specify a padding algorithm. For example: AES.encryptEes128Cbc(data, key, padding = Padding.PKCS7Padding) |
Beta Was this translation helpful? Give feedback.
Yeah it seems to be expected. But the error reported was a bit misleading. I have handled it here:
If the number of bytes you are providing in the data are not multiple of 16, you have to specify a padding algorithm.
For example: