Help: DecryptFinal error

2014-03-08 Thread Li, David
Hi, I am new to openssl C APIs. So I wrote a simple test to encrypt and decrypt a 15 byte ASCII string using AES128. The encryption seems OK and the encrypted length is 16. But the decryption always failed at EVP_DecryptFinal_ex(). The error code is 0 and means padding error. I have been search

Q: openssl dgst: unable to load key file error?

2012-07-17 Thread Li, David
Hi, I am trying to sign a file using dgst but not sure why I got this "unable to load key file". Here is the original command: openssl dgst -sha384 -out xyz.sig -sign $PWD/keys/my_private.pem xyz.to-be-signed The private key file my_private.pem DOES exist in the directory. The openssl versi

RE: Question on openssl dgst: which private key?

2012-06-24 Thread Li, David
-openssl-us...@openssl.org [owner-openssl-us...@openssl.org] On Behalf Of Dave Thompson [dthomp...@prinpay.com] Sent: Sunday, June 24, 2012 6:25 PM To: openssl-users@openssl.org Subject: RE: Question on openssl dgst: which private key? > From: owner-openssl-us...@openssl.org On Behalf Of Li, Da

RE: Question on openssl dgst: which private key?

2012-06-21 Thread Li, David
ssl-us...@openssl.org [mailto:owner-openssl- >us...@openssl.org] On Behalf Of Dave Thompson >Sent: Thursday, June 21, 2012 11:00 AM >To: openssl-users@openssl.org >Subject: RE: Question on openssl dgst: which private key? > >>From: owner-openssl-us...@openssl.org On Behalf Of Li, David >

Question on openssl dgst: which private key?

2012-06-21 Thread Li, David
Hi, How does openssl dgst know which signing algorithm it's supposed to use in openssl dgst? For example how does it figure out if this signing private key is a ECDSA key or RSA key? Is this information hidden in the "priv_key.pem" of the option -sign ? David

Questions on using openssl dgst to sign a msg.

2012-06-19 Thread Li, David
Hi Experts, I am new to openssl. Here is what I 'd like to do: I need to use ECDSA to sign a message. To start with I 'd like run some tests using NIST ECDSA SigGen vectors. They look like this example: Msg = 6b45d88037392e1371d9fd1cd174e9c1838d11c3d6133dc17e65fa0c485dcca9f52d41b60161246039e42e

List subscription question

2012-06-18 Thread Li, David
I am getting individual messages. Is it possible to subscribe in batch (diagest) mode? David

RE: Where is EVP_aes_256_gcm?

2012-05-23 Thread Li, David
That's good news. Where can I find a simple example how to use AES-GCM using EVP-* apis? David >-Original Message- >From: owner-openssl-us...@openssl.org [mailto:owner-openssl- >us...@openssl.org] On Behalf Of Dr. Stephen Henson >Sent: Wednesday, May 23, 2012 12:05 PM >To: openssl-users@o

RE: Where is EVP_aes_256_gcm?

2012-05-23 Thread Li, David
49 AM To: openssl-users@openssl.org Subject: Re: Where is EVP_aes_256_gcm? On 22/05/12 17:35, Li, David wrote: Hi All, I can't find this function in the source tree? It seems pointing to FIPS_aes_256_gcm. All I see is: grep -r FIPS_evp_aes_256_gcm . ./crypto/evp/evp_fips.c:const EVP_CIPHER *EVP

Where is EVP_aes_256_gcm?

2012-05-22 Thread Li, David
Hi All, I can't find this function in the source tree? It seems pointing to FIPS_aes_256_gcm. All I see is: grep -r FIPS_evp_aes_256_gcm . ./crypto/evp/evp_fips.c:const EVP_CIPHER *EVP_aes_256_gcm(void) { return FIPS_evp_aes_256_gcm(); } Anyone know where it is? David

RE: AES-GCM Gives Wrong Tag Value?

2012-05-20 Thread Li, David
-openssl-us...@openssl.org] On Behalf Of Dr. Stephen Henson [st...@openssl.org] Sent: Friday, May 18, 2012 10:17 AM To: openssl-users@openssl.org Subject: Re: AES-GCM Gives Wrong Tag Value? On Fri, May 18, 2012, Li, David wrote: > Hi Experts, > > First time I am using AES-GCM mode to run the

AES-GCM Gives Wrong Tag Value?

2012-05-18 Thread Li, David
Hi Experts, First time I am using AES-GCM mode to run the NIST test vectors. The API is: void AES_gcm128_encrypt(GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out, size_t len) After initialization and encryption, my cipher text matched the one fro