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!

Bouncy Castle Encryption for Large XML Files?

843811Aug 19 2009 — edited Aug 19 2009
Hi,

I am trying to encrypt files > 8 KB using the KeyBasedLargeFileProcessor Utility class of Bouncy Castle.
It's encrypting the file. But, unable to decrypt the same encrypted file. Hence it's encrypting incorrectly.

While trying to decrypt the encrypted file, it says "It was encrypted with a key (4E616D65) that does not exist"

Please suggest what change needs to be made in the 'encryptFile' method where it says -
"OutputStream cOut = cPk.open(out, new byte[1 << 16]);"

I tried changing the value, but it doesn't work. The maximum file size that we may encrypt is around 3 MB.

The files that are being encrypted / decrypted are XML files.

Any inputs are highly appreciated.

Thanks,
Tan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2009
Added on Aug 19 2009
2 comments
508 views