public static SecretKey createAESKey(){
  try {
    final KeyGenerator kgen=KeyGenerator.getInstance("AES");
    final int keySize=256;
    kgen.init(keySize);
    return kgen.generateKey();
  }
 catch (  final NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
  return null;
}

public static SecretKey createAESKey ( ) { try { final KeyGenerator kgen = KeyGenerator . getInstance ( "AES" ) ; final int keySize = 256 ; kgen . init ( keySize ) ; return kgen . generateKey ( ) ; } catch ( final NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; } return null ; }
generates a random aes key for encrypting / decrypting the turnover value attention : in a real cash box this key would be generated during the init process and stored in a secure area
