I'm trying to write a method to generate a Key to use for encryption where it takes an input string and returns a Key.
Where ALGORITHM is defined as "AES". However, whenever I try to use a password less or greater than 16 characters, Java outputs:Code:private Key generateKey() { Key key = new SecretKeySpec(this.keyValue, ALGORITHM); return key; }
What am I doing incorrectly?Code:java.security.InvalidKeyException: Invalid AES key length: 7 bytes
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks