Java AES Encryption/Decryption using a BigInteger as a key
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.
精彩评论