PGP 使用什么算法来使用密码加密私钥?

发布于 2024-09-11 00:50:37 字数 99 浏览 3 评论 0原文

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

The PGPKeyRingGenerator constructor takes in a passphrase to encrypt the private key. What is the algorithm that it uses to do this? It has a field called encAlgorithm, but I couldn't find any documentation explaining what these algorithms are.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半世蒼涼 2024-09-18 00:50:37

默认情况下,PGP 使用 IDEA(参考此)。

其他算法可以在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模式,没有填充。

By default, PGP uses IDEA (Refer this).

The other algorithms can be defined in encAlgorithm and following are supported by 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
}

They all use CFB mode with no padding.

素染倾城色 2024-09-18 00:50:37

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

It depends on PGP software, for example GPG uses CAST5 by default.

第七度阳光i 2024-09-18 00:50:37

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

摘自此维基百科页面
它应该是您正在寻找的。

PGP encryption uses a serial combination of hashing, data compression, symmetric-key cryptography, and, finally, public-key cryptography; each step uses one of several supported algorithms. Each public key is bound to a user name and/or an e-mail address. The first version of this system was generally known as a web of trust to contrast with the X.509 system which uses a hierarchical approach based on certificate authority and which was added to PGP implementations later. Current versions of PGP encryption include both options through an automated key management server.

Taken from this wikipedia page.
It should be what you are looking for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文