【问题标题】:What algorithm does PGP use to encrypt the private key using the passphrase?PGP 使用什么算法使用密码来加密私钥?
【发布时间】:2011-03-20 06:26:35
【问题描述】:

PGPKeyRingGenerator 构造函数接受一个密码来加密私钥。它用于执行此操作的算法是什么?它有一个名为 encAlgorithm 的字段,但我找不到任何解释这些算法是什么的文档。

【问题讨论】:

    标签: java bouncycastle pgp private-key


    【解决方案1】:

    默认情况下,PGP 使用 IDEA (Refer this)。

    其他算法可以在encAlgorithm中定义,OpenPGP支持以下算法,

    public interface SymmetricKeyAlgorithmTags
    {
        public static final int NULL = 0;        // Plaintext or unencrypted data
        public static final int IDEA = 1;        // IDEA [IDEA]
        public static final int TRIPLE_DES = 2;  // Triple-DES (DES-EDE, as per spec -168 bit key derived from 192)
        public static final int CAST5 = 3;       // CAST5 (128 bit key, as per RFC 2144)
        public static final int BLOWFISH = 4;    // Blowfish (128 bit key, 16 rounds) [BLOWFISH]
        public static final int SAFER = 5;       // SAFER-SK128 (13 rounds) [SAFER]
        public static final int DES = 6;         // Reserved for DES/SK
        public static final int AES_128 = 7;     // Reserved for AES with 128-bit key
        public static final int AES_192 = 8;     // Reserved for AES with 192-bit key
        public static final int AES_256 = 9;     // Reserved for AES with 256-bit key
        public static final int TWOFISH = 10;    // Reserved for Twofish
    }
    

    他们都使用没有填充的CFB模式。

    【讨论】:

    • 仅供参考:PGP 的企业版使用 AES256。
    • 没有“默认”之类的东西。 PGP Desktop 软件现在使用 AES,其他软件有不同的默认值,同时让您指定所需的算法。此外,IDEA 是专利算法,强烈不推荐使用。
    【解决方案2】:

    这取决于PGP软件,例如GPG默认使用CAST5。

    【讨论】:

      【解决方案3】:

      PGP 加密使用散列、数据压缩、对称密钥加密以及最后的公钥加密的串行组合;每个步骤都使用几种支持的算法之一。每个公钥都绑定到一个用户名和/或一个电子邮件地址。该系统的第一个版本通常被称为信任网络,与 X.509 系统形成对比,X.509 系统使用基于证书颁发机构的分层方法,后来被添加到 PGP 实现中。当前版本的 PGP 加密通过自动密钥管理服务器包括这两个选项。

      取自this wikipedia page。 它应该是您正在寻找的。​​p>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-05-06
        • 2021-09-04
        • 2014-09-05
        • 2013-01-13
        • 1970-01-01
        • 2012-08-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多