public byte[] getkey(string keycript)
{
byte[] decrypted;
byte[] mackey = fromHexString(keycript);
byte[] rawKeyData = fromHexString("3425342AE4DF3431");
SecureRandom sr = new SecureRandom();
DESKeySpec dks = new DESKeySpec(rawKeyData);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey key = keyFactory.generateSecret(dks);
Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding");
cipher.init(Cipher.DECRYPT_MODE, key, sr);
decrypted = cipher.doFinal(mackey);
return decrypted;
}
自己用了C#的DESC解密方法改了,但是结果不行,求砖家叫兽啊!
Java 解密 C#
------解决方案--------------------
砖家已挂,叫兽在撸。
------解决方案--------------------
我是高手,我已经帮你转了,给分吧
------解决方案--------------------
我去 你这样想解密?没这么简单!
能这么轻松解密谁还用DES加密啊
------解决方案--------------------