--PGP_Universal_59743BA0_60BF1FE0_6678099D_0E22010E
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_59743BA0_60BF1FE0_6678099D_0E22010E
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/AwUBR428TuS0sDso0rlaEQI1gwCfXU6gpBKz4b+lLnC9Y7oCWb 2Yp68An2K6
ixI1Asb2xQcr/j1SjTxJGB7z
=hU84
-----END PGP SIGNATURE-----

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