AES Negative bytes

前端 未结 2 1496
天命终不由人
天命终不由人 2021-01-07 15:55

The following is an extract from using AES encryption in Java:

  encryptedData =   encryptCipher.doFinal(strToEncrypt.getBytes());

The foll

2条回答
  •  借酒劲吻你
    2021-01-07 16:34

    You could turn it into a string with some encoding, like:

    encryptedData =   encryptCipher.doFinal(strToEncrypt.getBytes());
    String s = new String(encryptedData, "Base-64");
    

    Using the same standardized encoding, both C# and Java should be able to reconstruct each others encrypted data from that string.

提交回复
热议问题