Thanks for the sourcecode! I can see now, that 3DES really needs 3 keys so I'm wondering if 3DES is a bit "overkill" for my purpose. Does anyone have an example of how to do a simple DES (not 3DES) encryption using OpenSSL?
Thanks, Kim -----Oprindelig meddelelse----- Fra: Mariusz Jedrzejewski [mailto:[EMAIL PROTECTED]] Sendt: 12. august 2002 16:02 Til: Hellan,Kim KHE Emne: Re: 3DES encryption...newbie On Mon, Aug 12, 2002 at 03:39:13PM +0200, Hellan,Kim KHE wrote: > Hi Hi, > > I haven't worked with symmetric encryption, so this may be a simple problem > to you guys (I hope). > I have a text, "HELLO WORLD", that I want to encrypt using 3DES. It should > be encrypted with the password, "MYPASSWORD", which then later on can be > used when decrypting the text. > I have been looking in the docs and source files, but all this talk about > SALT and IV doesn't really ring a bell. > > It seems like a simple problem, so what OpenSSL functions must I call in > order to perform this encryption/decryption ? First of all, 3DES algorithm is based on 8-bytes set of keys. There is method with 2 or 3 different keys. So, you must provide 16 or 24 bytes to encrypt/decrypt your data. Algorithm is described in `man des`. The atachment contains simple C++ class, they are provide simple methods for doing encryption/decryption with 3DES. I'm not a mastah of c++, but main.c I've developed in numer of seconds ;-) I hope you understand me ;-) The result of encryption/decryption is encoded with base64, it's important with working with strings (imagine that is '\0' in encoded string - it's possible with 3DES). Last, I'm sorry for my ugly english, it isn't my native language... -- Pozdrawiam Mariusz Registered Linux User #206046 ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]