【发布时间】:2010-06-04 19:20:43
【问题描述】:
如何使用 java 加密在 AES 计数器模式下生成一次性密钥?我想在我的 PGP 实现中使用该一次性密钥作为会话密钥吗?
【问题讨论】:
标签: java encryption cryptography aes jce
如何使用 java 加密在 AES 计数器模式下生成一次性密钥?我想在我的 PGP 实现中使用该一次性密钥作为会话密钥吗?
【问题讨论】:
标签: java encryption cryptography aes jce
密钥生成不依赖于密码模式。要生成密钥,请使用KeyGenerator。
KeyGenerator aes = KeyGenerator.getInstance("AES");
aes.init(128);
SecretKey secret = aes.generateKey();
【讨论】: