On Thu, Mar 09, 2006, Manuel Arguelles wrote: > > $ openssl enc -d -rc4 -in out.bin -k mysecretkey > bad magic number > > what I'm I doing wrong? maybe the -k -K -iv options? as BIO_set_cipher as > well > maybe? >
With the default options the 'enc' command uses a salted key derivation algorithm which avoids certain known plaintext attacks. Those are particularly important with stream ciphers such as RC4. It also includes some data at the beggining of the data so that form can be recognized. Your program seems to be using the passphrase directly as the key. So the two formats are incompatible and the 'enc' program is detecting that. You can make the 'enc' command do the same if you use the -nosalt option. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]