BlackBerry Encryption AES 256 - No Padding
I want to encrypt data in BlackBerry using the AES 256 encryption method. The requirement is to encrypt with No Padding; 'AES/ECB/NoPadding'. I am passing a 16 byte array and the e
Solution 1:
There's a mistake in your Basic4Android code. You initialize the cipher with AES:
c.Initialize("AES/ECB/NoPadding")
but then initialize the key generator with TripleDES:
Kg.Initialize("DESede")
According to this documentation, just change "DESede" to "AES":
Kg.Initialize("AES")
Also, I wouldn't recommend using AES with ECB and no padding. It's insecure, especially when it's just as easy to use CBC or CTR mode. See this wikipedia article for an example of how unsafe it really is.
Post a Comment for "BlackBerry Encryption AES 256 - No Padding"