public SecretKey generateKey ( ) { SecretKey key = null ; try { KeyGenerator generator = KeyGenerator . getInstance ( "AES" ) ; generator . init ( 128 ) ; key = generator . generateKey ( ) ; } catch ( NoSuchAlgorithmException e ) { logger . error ( "Unable to generate AES key" , e ) ; } return key ; }
Generates a key for the AES encryption