On Wed, Nov 23, 2005, roro GRONAN wrote: > Hi everybody, > i'm new with the openssl libs (0.9.8a), I try to develop a program wich > need to produce a file that can be decrypted with the openssl command line > tool. > i choosed des_ede3_cbc as the syemtric algorithm. > > the "encryption" part of my code is given at the end of this post. > I verified with my debugger that the key/iv generated via EVP_BytesToKey () > is the same via my program and with the openssl comand line tool. > the file crypted with my program and with the openssl comand line tool > doesn't have many diffence (but they differs!) I inspected the first 384 > bytes of a 2 854 802 byte long file with a binary editor. > It show that at the offset 0x45 on my file there is one byte added (0x0d) > and at the offset 0x4d there is also another 0x0d added that's all for the > first 384 bytes! > I tryed with a 128 byte buffer and a 512 byte buffer I obtained exactly the > same output... >
0x0d in ASCII is the CR character which points to something not being in binary mode... > err += fopen_s(&fpCryptFile,argv[5], "w"); So have you tried "wb" mode in the line above? 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]