开发者

Java AES Encryption/Decryption using a BigInteger as a key

开发者 https://www.devze.com 2023-01-26 02:59 出处:网络
Is it possible to encrypt/de开发者_如何转开发crypt a string using AES with a BigInteger (given one, not a randomly generated number) as a key in Java?You don\'t need BigInteger for AES key creation, t

Is it possible to encrypt/de开发者_如何转开发crypt a string using AES with a BigInteger (given one, not a randomly generated number) as a key in Java?


You don't need BigInteger for AES key creation, the key needs to be 16 bytes long for 128-bit encryption, 24 bytes long for 192-bit encryption and 32 bytes long for 256-bit encryption.

So the key would be a byte array rather than a BigInteger. BigInteger is used in RSA and other PKI's because of the huge numbers needed to create the keys but AES doesn't do that.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号