After generating an AES key using:
keyGenerator = KeyGenerator.getInstance("AES"); keyGenerator.init(256); keyGenerator.generateKey();