RE: rsa_sign versus RSA_private_encrypt

2010-10-28 Thread Bob Dijck
14:31 To: openssl-users@openssl.org Subject: Re: rsa_sign versus RSA_private_encrypt On Thu, Oct 28, 2010, Bob Dijck wrote: > Thank you, Steve, for the swift reply. > Can I use i2d_X509_SIG to perform to encapsulation step (supposing I have to > use RSA_private_encrypt)? > Well yo

Re: rsa_sign versus RSA_private_encrypt

2010-10-28 Thread Kenneth Goldman
owner-openssl-us...@openssl.org wrote on 10/28/2010 03:07:18 AM: > From: Bob Dijck > > I am trying to implement a signing function in C++ using RSA. > Here’s how I wanted to do this: > - First I calculate the SHA1 hash (not using openssl but another > implementation). > - But then what? Sho

Re: rsa_sign versus RSA_private_encrypt

2010-10-28 Thread Dr. Stephen Henson
On Thu, Oct 28, 2010, Bob Dijck wrote: > Thank you, Steve, for the swift reply. > Can I use i2d_X509_SIG to perform to encapsulation step (supposing I have to > use RSA_private_encrypt)? > Well you can if you want but RSA_sign() does all that for you. There is an easier way: the encapsulation

RE: rsa_sign versus RSA_private_encrypt

2010-10-28 Thread Bob Dijck
. Stephen Henson Sent: donderdag 28 oktober 2010 12:32 To: openssl-users@openssl.org Subject: Re: rsa_sign versus RSA_private_encrypt On Thu, Oct 28, 2010, Bob Dijck wrote: > Hello, > > I am trying to implement a signing function in C++ using RSA. Here's how I > wanted to do this: - Firs

Re: rsa_sign versus RSA_private_encrypt

2010-10-28 Thread Dr. Stephen Henson
On Thu, Oct 28, 2010, Bob Dijck wrote: > Hello, > > I am trying to implement a signing function in C++ using RSA. Here's how I > wanted to do this: - First I calculate the SHA1 hash (not using openssl but > another implementation). - But then what? Should I use RSA_private_encrypt > or rsa_sign

Re: RSA_sign RSA_verify

2008-11-18 Thread Shaun
Thanks, thats what i get for being lazy, for testing i was just using a small key, i just changed it to my 4096 key and it's working.. Where am i going wrong here? char* message = "Hello World"; if(RSA_sign(NID_md5, (unsigned char*) message, strlen(message), signature, &

RE: RSA_sign RSA_verify

2008-11-18 Thread David Schwartz
> Where am i going wrong here? > char* message = "Hello World"; > if(RSA_sign(NID_md5, (unsigned char*) message, strlen(message), > signature, &slen, private_key) != 1) { The problem is that your RSA key is very small. A 256-bit RSA key can only sign up to 32 bytes. 11 bytes are

Re: RSA_sign, RSA_verify and padding

2008-09-19 Thread Dr. Stephen Henson
On Fri, Sep 19, 2008, Marco Sommella wrote: > Hi, > I'm using OpenSSL 0.9.8a 11 Oct 2005 (+ security patches to 2007-10-13) on > opensolaris 2008.11 b97 and programming in C. > My question is about the message digest *m used into functions in object.* > ** > *I have notice a strange *behavior conc

Re: RSA_sign error

2005-02-24 Thread Marco Roeland
Op donderdag 24 februari 2005 om 12:33 uur schreef Manuel Sánchez Cuenca het volgende: > Hello all, I'm writting a C program to sign a char[] with the following > code: > == > FILE *pKeyFile = fopen("srv-key.pem", "r"); > RSA *rsa_key =

Re: RSA_sign

2002-06-24 Thread Nils Larsch
> > The input to RSA_sign() must be smaller than BN_num_bytes(rsa->n) minus > > PKCS#1 padding bytes and some bytes for the asn1 digest encoding. > > where is it written ? The RSA signature generation is specified in the PKCS#1 draft ( http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/index.html )

Re: RSA_sign

2002-06-24 Thread julien Bournelle
> > The input to RSA_sign() must be smaller than BN_num_bytes(rsa->n) minus > PKCS#1 padding bytes and some bytes for the asn1 digest encoding. where is it written ? > > [...] > > so I don't understand what is going on with the value 100...and more I > > don't know how to sign my real buffer (

Re: RSA_sign

2002-06-24 Thread Nils Larsch
> Hi all, > > thanks for your help on DH stuff :-) > Now I have a pb with RSA_sign(). > > I have a buffer and I want to sign it with my private key. > > So I generate a key: > > openssl genrsa -out key.pem 1024 > > then I have the following code: > > " > rsa = RSA_new(); > get_my_priv_RSA(&rsa);