[openssl-users] decrypt data with rsa privated key failed

2017-03-23 Thread Yu Wei
Hi guys, I generated RSA private key and public key as below, openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:2048 openssl rsa -pubout -in pri.key -out pub.key And encrypted text file as below, openssl pkeyutl -encrypt -pubin -inkey ~/pub.key -in ~/1.txt -out ~/1e.txt

Re: [openssl-users] One question about RSA decrypt with private key

2017-03-23 Thread Salz, Rich via openssl-users
> For encrypting user data such as user's password, could I use PKCS#1 or OAEP > padding mode? If you do not know what you are doing, use the defaults. -- openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

Re: [openssl-users] regarding memory cleanup at end of each DTLS session

2017-03-23 Thread svineet
I did try dumping the memory state after freeing the ssl session at the end of each call using CRYPTO_mem_leaks_fp(stderr); Keep getting on the console alternately 74372 bytes leaked in 32 chunks [18:27:48] 2830 file=pqueue.c, line=95, thread=139766236079872, number=16, address=7F1D6CA32060

Re: [openssl-users] One question about RSA decrypt with private key

2017-03-23 Thread Yu Wei
Hi Matt, I checked openssl source code. It seems that PKCS#1 is default padding mode. For encrypting user data such as user's password, could I use PKCS#1 or OAEP padding mode? Thanks, Jared, (韦煜) Software developer Interested in open source software, big data, Linux

Re: [openssl-users] One question about RSA decrypt with private key

2017-03-23 Thread Salz, Rich via openssl-users
> After commented out the line "EVP_PKEY_CTX_set_rsa_padding(ctx, > RSA_NO_PADDING)",? it worked well. You need to do some reading about basic RSA cryptography. Signatures are padded out to the keysize. -- openssl-users mailing list To unsubscribe:

Re: [openssl-users] openssl-users Digest, Vol 28, Issue 21

2017-03-23 Thread Matt Caswell
On 23/03/17 03:47, Kane Huang wrote: > Hi guys, > > I want to use "multiblock" introduced from 1.0.2 to improve performance > of ipsec packet process, which use aes_cbc_hmac_sha as main algorithm. > > I have try openssl speed test with ‘-mb’ and I observe that the test > code use big buffer

Re: [openssl-users] One question about RSA decrypt with private key

2017-03-23 Thread Matt Caswell
On 23/03/17 05:29, Yu Wei wrote: > After commented out the line "EVP_PKEY_CTX_set_rsa_padding(ctx, > RSA_NO_PADDING)", it worked well. > > > However, I still quite understand the usage of "RSA_NO_PADDING". > > > Who could kindly explain this? > RSA_NO_PADDING gives you "raw" RSA

Re: [openssl-users] unsigned char * public key to evp_pkey o ec_key

2017-03-23 Thread Matt Caswell
On 22/03/17 17:59, Christian Adja via openssl-users wrote: > Good evening everybody,I need help about to transform public key > (unsigned char *) retrieved from IEEE cert in EVP_PKEY o EC_KEY. The > public key is an ecdsaNistP256 in compressed form (compressedy1). > The public key form in hex =

Re: [openssl-users] One question about RSA decrypt with private key

2017-03-23 Thread Yu Wei
After commented out the line "EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_NO_PADDING)", it worked well. However, I still quite understand the usage of "RSA_NO_PADDING". Who could kindly explain this? Thanks, Jared, (韦煜) Software developer Interested in open source software, big data, Linux