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!

Irregularity in SunJCE encryption: CFB/NoPadding & OFB/NoPadding

843810Jul 3 2003 — edited Jul 8 2003
Hi everybody,

I've written a jsp to test the various transformations for SunJCE block ciphers. I combined one of the three cryptographic algorithms (DES, DESede, Blowfish) with one of the five operating modes (ECB, CBC, CFB, OFB, PCBC) and one of the two padding schemes (NoPadding, PKCS5Padding) to form a transformation string for each test. I have tested all 30 (3*5*2) different transformations. Most of them produced perfect results, thus, when first encrypted a plain text file with a secretKey and IV then decrypted the encrypted file with the same key and IV the decryptd file is exactly identical to the original.

Only 6 out of 30, however, gave me the same text file PLUS some extra character(s) at the end of the file. Those transformations are the ones that use CFB or OFB with NoPadding.

Since I am new to JCE, and I didn't read book/docs says about we can't use NoPadding with CFB or OFB, I wonder if anyone knows anything about this irregularity? Also, other than the extra few characters the decrypted file looks just perfect. Why? Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2003
Added on Jul 3 2003
5 comments
299 views