tags:

views:

362

answers:

1

I'm busy trying to port Java code that looks like this

        Cipher rsa = Cipher.getInstance("RSA/ECB/nopadding");
  rsa.init(Cipher.DECRYPT_MODE, RSAPrivateKey);
  decryptedData = rsa.doFinal(data, 0, 128);

to C#, but as it seems the RSACryptoServiceProvider, forces you to either use OEAP or PKCS1 padding. I know no padding isn't secure, but in this case Im working with a closed source client, so I can't do anything about that. Is there any way around this padding issue?

A: 

You might want to get the code from BouncyCastle, http://www.bouncycastle.org/csharp/, and modify the code from the link below, and ensure that it can use the encryption that you list above.

http://www.java2s.com/Code/Java/Security/Whatisinbouncycastlebouncycastle.htm

James Black
I'll try that, thanks.
Fauxide