我必须解密用Java编码的密码短语
byte[] phraseBlock = [-9, -101, -14, -63, 26, 127, -128, 121];
SecretKey secretKey = new SecretKeySpec(keyBytes, "DES");
Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] encryptedPhaseBlock = cipher.doFinal(phraseBlock );现在,加密后,它将发送到我的PHP代码
十六进制加密phraseBlock = F79BF2C11A7F8079
十六进制加密encryptedPhaseBlock = A8B0E35246430D25
openssl_decrypt(hex2bin('F79BF2C11A7F8079'), 'DES-ECB', hex2bin('A8B0E35246430D25'))做完这件事后,我就错了。
发布于 2019-12-07 10:14:07
我不知道"byte[] phraseBlock“是什么意思,但如果你这样做的话:
bin2hex(openssl_decrypt(hex2bin('F79BF2C11A7F8079'), 'des-ecb', hex2bin('A8B0E35246430D25'), OPENSSL_RAW_DATA + OPENSSL_ZERO_PADDING));你得到了结果
f699257c6ec30770https://stackoverflow.com/questions/59116138
复制相似问题