Filling a RSA *key variable with a public key from a Hex string

2009-09-07 Thread Einar Thorsrud
Hi all, I am having some trouble finding a library/API function which makes it possible to specify the public (or private) encryption key as a Hex string. PEM_read_bio_RSA_PUBKEY will not do it for me, as I do not have a PEM-file. My alternative is to insert the data directly into the rsa_st

Re: Filling a RSA *key variable with a public key from a Hex string

2009-09-08 Thread Einar Thorsrud
On Mon, Sept 07, 2009 Dr. Stephen Henson wrote: Currently you have to set the key components manually in the RSA structure. Thank you for your quick and helpful answer. I will try that. However, I am having problems understanding which part of the hex key string goes where. Do you know how I

RSA OAEP encrypt with a label

2009-09-09 Thread Einar Thorsrud
Hi all, How is it possible to RSA OAEP encrypt using a label in addition to the public encryption key and the message width libcrypto? The operation would be that of RSAES-OAEP-ENCRYPT((n, e), M, L), as specified in the RSA Cryptography Standard version 2.1. I do not find any possibility to add

Re: RSA OAEP encrypt with a label

2009-09-10 Thread Einar Thorsrud
on., 09.09.2009 kl. 10.25 +0200, skrev Einar Thorsrud: I do not find any possibility to add the label to the RSA_public_encrypt() function, but it could perhaps be achieved otherwise? Could the label perhaps be related to the *p parameter in int RSA_padding_add_PKCS1_OAEP(unsigned char

Re: RSA OAEP encrypt with a label

2009-09-11 Thread Einar Thorsrud
Thank you Martin. I have tried using the function, however using the code I have pasted below I get the error Error = oaep decoding error when trying to unpadd to retrieve the original data. For simplicity the code I have added here does not encrypt/decrypt, but only attempts to pad and unpadd.