|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to decipher data in .NET using "RSA/ECB/PKCS1Padding"?I am receiving RSA encrypted data with the digital signature. The data and signature is encrypted in Java using RSA Public key encryption. I have to verify the signature in C#.NET and decrypt the data and process. I am able to verify the signature using sender's Public key. But I am facing problems in decrypting data using my Private Key. I am not not able to an equivalent C# API which deciphers the data using "RSA/ECB/PKCS1Padding" transformation. I am able to do it in Java using following code. Does anybody know, What will be the equivallent .NET code for follwing Java Code?. Java Code: ======== byte[] dataBytes = new BASE64Decoder().decodeBuffer(decodedToken); RSAPrivateKey privateKey = getPrivateKey(keystoreFile, aliasName, password, keyPassword); Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); cipher.init(Cipher.DECRYPT_MODE, privateKey); String plaintext = new String(cipher.doFinal(dataBytes)); Any help would really be appreciated. Thanks in advance. ----- Ajay Jadhav http://www.divinet.co.in It's been a while since I have been involved with crypto and .NET but have a
look at the info here: http://www.jensign.com/JavaScience/dotnet/RSAEncrypt/ - Mitch Show quoteHide quote "Ajay Jadhav" <a***@itcube.net> wrote in message news:9D5FA9F2-2EF1-48ED-835E-EC1261440246@microsoft.com... > Hi, > > I am receiving RSA encrypted data with the digital signature. The data and > signature is encrypted in Java using RSA Public key encryption. I have to > verify the signature in C#.NET and decrypt the data and process. I am able > to verify the signature using sender's Public key. But I am facing > problems in decrypting data using my Private Key. I am not not able to an > equivalent C# API which deciphers the data using "RSA/ECB/PKCS1Padding" > transformation. > > I am able to do it in Java using following code. Does anybody know, What > will be the equivallent .NET code for follwing Java Code?. > > Java Code: > ======== > byte[] dataBytes = new BASE64Decoder().decodeBuffer(decodedToken); > RSAPrivateKey privateKey = getPrivateKey(keystoreFile, aliasName, > password, keyPassword); > Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); > cipher.init(Cipher.DECRYPT_MODE, privateKey); > String plaintext = new String(cipher.doFinal(dataBytes)); > > Any help would really be appreciated. > > Thanks in advance. > ----- > Ajay Jadhav > http://www.divinet.co.in
Using a Java Keytool created certificate in HTTPWebRequest.ClientCertificates
Can't import x.509: Cannot find the requested object Don't understand System.Security.SecurityException 'Global\.net clr networking' is denied - via IPAddress.TryParse Possible spyware problem Question about TCP/IP and SSL with sslstream Request for the permission of type IPsec in Vista brastk virus doesn't allow to visit legitimate web sites 256 k encryption |
|||||||||||||||||||||||