签名文件时密钥长度有何不同?

发布于 2024-11-26 06:05:48 字数 270 浏览 4 评论 0原文

我从未上过任何有关加密或安全的课程,我正在尝试自学一些基础知识,所以如果这是一个愚蠢的问题,请原谅我(别担心,我不会做任何敏感的事情)

所以,我'我正在使用 Crypto++,以便我可以对文件进行签名,以查看该文件是否已被除我之外的其他人编辑过。该库附带的测试应用程序看起来有选项(rs 和 rv),它们完全可以在我自己的程序中执行我想要执行的操作(验证文件签名的完整性)。当然,在此之前我需要生成公钥和私钥。当使用测试应用程序的 g 选项执行此操作时,它要求我指定密钥长度(以位为单位)。密钥长度有什么区别?

I've never taken any classes on encryption or security and I'm trying to teach myself some basics, so forgive me if this is a silly question (don't worry, I'm not working on anything sensitive)

So, I'm playing around with Crypto++ so that I can make a signature of a file to see if the file has been edited by someone other than me. The test application that comes with the library looks like it has options (rs and rv) that do exactly what I want to do in my own program (verify the integrity of the signature of a file). Of course, before doing that I need to generate a public and private key. When doing so with the test application's g option it asks me to specify the key length in bits. What difference does the key length make?

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

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

发布评论

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

评论(1

笛声青案梦长安 2024-12-03 06:05:48

密钥长度决定了某人破解您的密码的难度。对于数字签名来说,这意味着某人生成假签名的难度有多大。

对于 RSA,1024 位的密钥长度足以满足非敏感信息,但它只能使用几年,然后更换为新密钥。 2048 位更强,4096 位更强。

对于天真的暴力攻击者来说,在密钥长度中添加一位会使他们破坏密钥所需的工作量增加一倍。然而,像 RSA 这样的算法不会以这种方式扩展:2048 位 RSA 密钥的破解难度不是 1024 位密钥的 2^1024 倍。

一般来说,公钥算法(例如 RSA)需要比对称密钥算法(例如 AES)大得多的密钥,因为它们依赖于不同的数学属性。

要获得有关密码学的良好入门知识,您应该查看 Peter Gutmann 的 godzilla 加密教程。它非常易读,可以让您很好地了解加密货币如何以各种形式工作。

The key length determines how hard it is for someone to break your cryptography. For digital signatures, that means how hard is it for someone to generate a fake signature.

For RSA a key length of 1024 bits is sufficient for non-sensitive information, but it should only be used for a few years and then replaced with a new key. 2048 bits is stronger and 4096 is stronger still.

For a naive brute-force attacker, adding a single bit to the key length doubles the amount of work they need to do to compromise your key. However, algorithms like RSA do not scale in this way: a 2048-bit RSA key is not 2^1024 times as hard to break as a 1024-bit key.

Generally public key algorithms (e.g. RSA) need much larger keys than symmetric key algorithms (e.g. AES) because they rely on different mathematical properties.

For a good primer on cryptography you should check out Peter Gutmann's godzilla crypto tutorial. It's pretty readable and gives you a good overview of how crypto works in its various forms.

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