0
votes

Friends,

I am using J2ME WTK 2.5.2 for Application Mobile Development and I am using Base64 Encryption Method in join with Cipher. The Encryption and Decryption works are expected.

My problem is when I encrypt the String with Base64 Encryption or with Cipher, the Size of the String increases (ie if Original Size of String is 10 Characters, it increases size to 15 characters). I am storing some to the device itself so store space is an big issue. I looking for the Encryption method which does not increase the String Size.

1
base64 encoding increases the size.Meier

1 Answers

0
votes

Without a code example, it's not entirely clear what you are already doing. But many encryption modes (such as ECB or CBC) when combined with a padding scheme will produce encrypted data that is a little larger than the input.

If you need it to be exactly the same size, try a mode like CFB.