--PGP_Universal_4A480874_62A20FBE_F2BF9C43_DBFE3DFB
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hi!

I want to transfer RSA encrypted Data from a linux application to a .net we=
bservice. I'm encrypting data with the method
RSA_public_encrypt with RSA_PCKS1_OAEP_PADDING.

On the .net side i get the error:

----------------
System.Security.Cryptography.CryptographicExceptio n: Padding is invalid and=
cannot be removed.
at System.Security.Cryptography.RijndaelManagedTransf orm.DecryptData(Byt=
e[] inputBuffer, Int32 inputOffset, Int32 inputCount,
Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean =
fLast)
at System.Security.Cryptography.RijndaelManagedTransf orm.TransformFinalB=
lock(Byte[] inputBuffer, Int32 inputOffset, Int32
inputCount)
at System.Security.Cryptography.CryptoStream.Read(Byt e[] buffer, Int32 o=
ffset, Int32 count)
----------------

If i change the padding parameter to RSA_PKCS1_PADDING it get the different=
error:

----------------
System.Security.Cryptography.CryptographicExceptio n: Error occurred while d=
ecoding OAEP padding.
at System.Security.Cryptography.Utils._DecryptPKWin2K Enh(SafeKeyHandle h=
PubKey, Byte[] key, Boolean fOAEP, Int32& hr)
at System.Security.Cryptography.RSACryptoServiceProvi der.Decrypt(Byte[] =
rgb, Boolean fOAEP)
----------------

So OAEP padding seem to be more correct.

Does anybody know if i have to padd the buffer by using RSA_padding_add_PKC=
S1_OAEP() before giving the buffer to the encryption
function or what can be wrong here?

Any help is welcome...
Bernd





--PGP_Universal_4A480874_62A20FBE_F2BF9C43_DBFE3DFB
Content-Type: application/pgp-signature;
x-mac-type=70674453;
name=PGP.sig
Content-Disposition: attachment; filename=PGP.sig

-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.6.3 (Build 3017)

iQA/AwUBR4zxieS0sDso0rlaEQIJAgCdGINmVuApj5NvXHBQO6t6kg yq7gsAn384
KMjfdazuHCkX3l5y3NBsf5rd
=ntHp
-----END PGP SIGNATURE-----

--PGP_Universal_4A480874_62A20FBE_F2BF9C43_DBFE3DFB--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org