By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,706 Members | 1,406 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,706 IT Pros & Developers. It's quick & easy.

Encrypt image (jpg) in C#.NET and Decrypt the same in Java

P: 3
I have an image (.jpg/.bmp) to be encrypted in C#.NET. The same encrypted image has to be Decrypted in Java. Any help on this is appreciated.
Apr 23 '09 #1
Share this Question
Share on Google+
4 Replies


Nepomuk
Expert 2.5K+
P: 3,112
What kind of encryption were you thinking about? Theoretically, if you use the same algorithm on both sides (but reverse for decrypting of course), it should work. Of course, you may have to pass a key or something like that.

Greetings,
Nepomuk
Apr 23 '09 #2

P: 3
Thanks a Lot!

I am trying to use any algorithm. We can use a common DES algorithm on both c#.net and Java. But DES is very insecure and is not recommended to be used.

I would rather prefer Rijndael Algorithm for encryption on C#.Net. I am not sure what algorithm is equivalent to this one on Java. My guess is AES algorithm on Java.
Apr 23 '09 #3

Nepomuk
Expert 2.5K+
P: 3,112
According to Wikipedia, "Rijndael Algorithm" is just another name for AES. Mind you, algorithms aren't language specific, you could implement any of the standard algorithms in any of the standard languages. I don't know if they are available within the standard libraries, but you could always implement them yourself.

Greetings,
Nepomuk
Apr 23 '09 #4

P: 5
Probably today the more secure algorithm, and the most adopted, for symmetric encryption is AES.
You can use it to encrypt your image (as file stream) in C# and decrypt in Java. Remember that AES is a standard algorithm and the C# and JAVA implementation must be the same. If a encrypted stream is encrypted with a standard symmetric algorithm in one of the two platform, it will be decrypted by the other, due to the standardization of the algorithm.
To quickly encrypt your image with c# you can try Bonnie.NET at http://www.we-coffee.com/bonnie.aspx. It is a free dll that manages all cryptographic needs when developing with .NET
Sep 26 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.