Using java to encrypt integers

后端 未结 7 1496
野性不改
野性不改 2021-02-03 14:14

I\'m trying to encrypt some integers in java using java.security and javax.crypto.

The problem seems to be that the Cipher class only encrypts byte arrays. I can\'t d

7条回答
  •  情话喂你
    2021-02-03 15:17

    You can also use BigInteger for conversion:

     BigInteger.valueOf(integer).toByteArray();
    

提交回复
热议问题