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.
Code:
private Key generateKey() {
        Key key = new SecretKeySpec(this.keyValue, ALGORITHM);
        return key;
    }
Where ALGORITHM is defined as "AES". However, whenever I try to use a password less or greater than 16 characters, Java outputs:
Code:
java.security.InvalidKeyException: Invalid AES key length: 7 bytes
What am I doing incorrectly?