java写的DES的cbc工作模式解密时出现乱码

public static byte[] cbcdesDecrypt(byte[] data, byte rawKeyData[])
throws GeneralSecurityException {

    DESKeySpec keySpec=new DESKeySpec(rawKeyData);  
    SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES");  
    SecretKey key=keyFactory.generateSecret(keySpec);  

    Cipher cipher=Cipher.getInstance("DES/CBC/NoPadding");  
    cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(rawKeyData));  
    byte[] result=cipher.doFinal(data);  
    return result;  
}  
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问