2010-06-04 79 views

回答

4

密鑰生成不依賴於密碼模式。要生成密鑰,請使用KeyGenerator

KeyGenerator aes = KeyGenerator.getInstance("AES"); 
aes.init(128); 
SecretKey secret = aes.generateKey();