`I want to encode my string using .net and pass it to a java program. I am using the same program for encryption and decryption on both the sides. But the java program and .net programs are returning different MD5 hash codes.
Here are the codes for both my programs :
md5Provider = New MD5CryptoServiceProvider()
input = UTF8Encoding.UTF8.GetBytes(sSecurityKey)
oHash = oMd5CryptoServiceProvider.ComputeHash(input)
m = MessageDigest.getInstance("MD5");
byte UTF8bytes = key.getBytes("UTF8");
At last I found the answer. I just converted the Md5 hash into BigInteger and then converted into an byte array. Now when i pass it as a key to the DES algorithm, i get my desired output.