This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes RSA Encryption / Decryption does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "RSA Encryption / Decryption does not work" Watch "RSA Encryption / Decryption does not work" New topic
Author

RSA Encryption / Decryption does not work

Marcus Didius Falco
Ranch Hand

Joined: Feb 25, 2007
Posts: 72
Hello,
to try out Java security features I have written the following class (I know I would not be really usefull, just for trying the API):



I call it with the following code



However the original messages is not restored.
decrypted contains a String of zero-length.

Where is the mistake??

Thanks for any input,

Hans
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

Check out line 22.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Marcus Didius Falco
Ranch Hand

Joined: Feb 25, 2007
Posts: 72
I must be blind...

Thanks a lot

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

You're welcome
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: RSA Encryption / Decryption does not work
 
Similar Threads
RSA decryption, BadPaddingException: Data must start with zero
BadPaddingException using AES
Length of Encrypted String Longer than Original String... Help
Digital Signature in PKCS 7 format with base 64 encoding
Need Help in Encryption