Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm using the openssl package for a project I'm working on, and have come across the following in the RSA_public_encrypt man page.
"Raw RSA encryption. This mode should only be used to implement cryptographically sound padding modes in the application code. Encrypting user data directly with RSA is insecure."
What I would like to know is why this is insecure, and how does padding help. I've tried padding using RSA_PKCS1_OAEP_PADDING, but this causes data to encrypt to different "target" values. So say I encrypt the string "this string is to be encrypted" 5 or 6 times, I will end up with 5 or 6 different encrypted versions. For what I'm using it, this is not quite acceptable - the same string should encrypt to the same value each and every time (yes - this is probably slightly insecure - but it is needed). So what I did was pad whatever I get upto a multiple of 128 bytes with 0's (I still want to change this, based upon the input data pad it otherwise). Then encrypt each block of 128 bytes with no padding. Is this ok, or is it as the man pages suggest - REALLY BAD.
Maybe this, this or this can help.
*Citeseer has a *lot* of references, you just gotta know how to get to the actual text. Select a reference, select update, and the URI then is at the bottom of the page.