Hello,
I need to convert the Java code to C#, Can anyone help me? This is urgent, Thanks
private static String decrypt(String key, String cypherText)
{
byte[] bytes = toBytes(cypherText);String newClearText = "";
try
{
DESKeySpec desKey = new DESKeySpec(key.getBytes());Key cypherKey = (Key)new SecretKeySpec(desKey.getKey(), "DES");
Cipher des = Cipher.getInstance("DES/CBC/PKCS5Padding");
des.init(Cipher.DECRYPT_MODE, cypherKey, paramSpec);
newClearText = new String(des.doFinal(bytes));
}
catch(Exception excep)
{
System.out.println("Decrypt Error:");
excep.printStackTrace();
}
return newClearText;
}