This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Security and the fly likes Help! Problem with Encryption! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Help! Problem with Encryption!" Watch "Help! Problem with Encryption!" New topic
Author

Help! Problem with Encryption!

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I'm trying to create a key, use that to encrypt something and then use it to decrypt. I am using the example DESExample that comes with bouncy castle. It throws this exception in decrypting everytime:
org.bouncycastle.crypto.DataLengthException: last block incomplete in decryption
It happens in: org.bouncycastle.crypto.BufferedBlockCipher.doFinal(...) (or if I change to use the newer class, it still occurs in: org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(...) )
Does anyone know what this problem could be? The example:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! Problem with Encryption!