you mean like this? $ openssl enc -d -rc4 -in out.bin -k mysecretkey -nosalt ¨Å¥ óVRCÑÆMðù6o
or maybe using the -K -iv options key[0]=0xA0; key[1]=0xA1; iv[0]=0xB0; iv[1]=0xB1; BIO_set_cipher(cipher, EVP_rc4(), key, iv, 1); can I use openssl enc -d -rc4 -in out.bin -K A0A1 -iv B0B1 ?? On Thu 09 Mar 2006 18:23, Dr. Stephen Henson wrote: > 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] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]