【问题标题】:Generate one-time key with AES in Counter mode在计数器模式下使用 AES 生成一次性密钥
【发布时间】:2010-06-04 19:20:43
【问题描述】:

如何使用 java 加密在 AES 计数器模式下生成一次性密钥?我想在我的 PGP 实现中使用该一次性密钥作为会话密钥吗?

【问题讨论】:

    标签: java encryption cryptography aes jce


    【解决方案1】:

    密钥生成不依赖于密码模式。要生成密钥,请使用KeyGenerator

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-27
      • 1970-01-01
      • 2012-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-31
      • 1970-01-01
      相关资源
      最近更新 更多