Re: EVP_* Routines

2002-01-02 Thread Chris Plant

ok, thanks.

I did look at the EVP_EncryptInit man page, but the code I had there,
was loosely based on some code I found on the net, they probably had the
same problem.


Chris

[EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: EVP_* Routines

2002-01-02 Thread Juan Segarra

On 2 Jan 2002, Chris Plant wrote:

 I've compiled the attached code, and it doesn't decrypt the text
 correctly.  If anyone could explain why to me, or point out a nice
 tutorial about using these routines, it would be much appreciated.


I've been writing a tutorial about EVP routines in spanish (i'll wrote an
english version after my exams :-P)... perhaps you'll find it useful (or
useless :-P).

http://spisa.act.uji.es/~juan/tutoriales/openssl/evp/

je,je,je... use at yout own risk ;-P


__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: EVP_* Routines

2002-01-02 Thread Chris Plant

On Wed, 2002-01-02 at 18:00, Juan Segarra wrote:
 On 2 Jan 2002, Chris Plant wrote:
 
  I've compiled the attached code, and it doesn't decrypt the text
  correctly.  If anyone could explain why to me, or point out a nice
  tutorial about using these routines, it would be much appreciated.
 
 
 I've been writing a tutorial about EVP routines in spanish (i'll wrote an
 english version after my exams :-P)... perhaps you'll find it useful (or
 useless :-P).
 
   http://spisa.act.uji.es/~juan/tutoriales/openssl/evp/
 
 je,je,je... use at yout own risk ;-P
 
 
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing List[EMAIL PROTECTED]
 Automated List Manager   [EMAIL PROTECTED]

Thanks, I managed to make some sense of it, and I'm getting somewhere
with my software now.

Chris Plant


__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: EVP_* Routines

2002-01-01 Thread Dr S N Henson

Chris Plant wrote:
 
 I've compiled the attached code, and it doesn't decrypt the text
 correctly.  If anyone could explain why to me, or point out a nice
 tutorial about using these routines, it would be much appreciated.
 
 ircd_malloc() is basically malloc() with memset().
 

There's an example in the EVP_EncryptInit manual page. It also includes
the comment:

 /* Need binary mode for fopen because encrypted data is
  * binary data. Also cannot use strlen() on it because
  * it wont be null terminated and may contain embedded
  * nulls.
  */

This is one problem with your code: you are using strncpy and strncat.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Gemplus: http://www.gemplus.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]