views:

70

answers:

1

hi all,

I want to know the any Encryption-Decryption Algorithm (procedure) that can be implemented in C#.net as well as in Java. I have came accross a situation where, the data is encrypted by a C# code implemented using RSA using "RSACryptoServiceProvider" class and put it in Database. Now , I need to decrypt the same data in the Java reading it from Database.

While implementing RSA Decrypt method in Java its not working, (I made sure using the same keys). Following method has been used in C# for encryption.

http://www.codeproject.com/KB/security/RSACryptoPad.aspx

Hence, I need to know any standard algorithm for encryption, that can be used in C# and Java so that data can be encrypt - decrypt across the each other platform.

+2  A: 

You might want to start off by understanding the difference and the impact of the selected algorithm. You can implement these encryptions on your own, here are some examples.

Implemeting RSA in C#

Java RSA Code

Another encryption method is AES

Implementing in in C#

Using AES With Java

Wikipedia is a very good reasource for information about encryption and decryption.

Filip Ekberg
Filip: Say I take implementing RSA. I have been using "RSACryptoServiceProvider" for encrypting. Now I implement RSA using JAVA for Decryption. So I am using Same RSA algorithm for both languages. Still, when I try to decrypt the data in Java that has been encrypted in C#.. It fails everytime.
Sumeet