Monday, March 10, 2014

RSA operation error
5747:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:151:
Basically RSA is not aimed to encrypt large data file, so you will get this error when you try to encrypt a file such as length(file) > length(RSA key).
I suggest to calculate first hash version of the file using MD5 or SHA-1 then encrypt it using the key.

Note: in real cryptographic system, RSA public/private key are only used to exchange symmetric key.

0 comments:

Post a Comment