不对称和对称加密方法的区别? [英] Difference between asymmetric and symmetric encryption methods?

查看:120
本文介绍了不对称和对称加密方法的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OK我很困惑,这两种加密方式是如何工作的。我知道对称是常规的,并且在两个用户之间使用一个共享的私钥。



基本上,我想知道


  1. 他们的工作原理


  2. 他们的目的


  3. 他们的非对称和对称加密方法的相对性能



$ b

解决方案

我建议从应用密码学。这是对密码学所涉及的原理的一个很好的介绍。



如果您对密码术感兴趣,那么我强烈建议应用密码学手册作为一个惊人的参考工作。首先处理起来太多了,但是它是免费的,所以现在去抓一个副本:),当你完成AC,读HAC。 (实际上,精装版是非常好的,比几百页的激光打印纸更容易阅读,如果你喜欢PDF的样子,请考虑购买。)



对称加密通过将秘密输入与秘密密钥混合起来,使得(a)快速(b)不能从输出中导出输入或键。混合的细节变化很大,但分组密码流密码;通过一次查看8或16或32字节块中的输入数据,并将这些块中的输入和键扩散,才能使块分组密码工作。需要不同的操作模式来加密更多的数据,而不是适应块,而不同的操作模式可能或可能不会在块之间传播数据。



对称密码对于大量数据加密来说非常棒,从8字节到8 TB,是加密<数据。



非对称加密通过利用后门非常困难的数学问题起作用,使得快速解决问题,如果你有一小部分非常重要的数据。通常的数学问题是分解大数字离散对数。不对称算法适用于固定数据大小,通常用于 RSA 的1024-2048位和 El Gamal ,384位的椭圆曲线版本的RSA或El Gamal。 (椭圆曲线版本使用不同于其计算的整数的字段。RSA和El Gamal和类似的系统可以与指定乘法添加操作的任何字段一起工作,ECC具有不同于该字段的表示将更多的数据打包成一个超级聪明的方法,使众所周知的机制适应较少的记忆,我的一句话介绍不能开始正义,简单是令人惊奇的部分。 p>

不对称加密有助于解决密钥分发问题 ,但只是勉强地:而不是每个希望使用加密技术的人之间需要O(N ^ 2)个密钥对,它需要O(N)个密钥,每个人一个公共/私有对,每​​个人都需要知道其他人的 public 部分。这不是一个简单的问题,因为 x509 的复杂性演示了,但是 openPGP OpenSSH 具有更简单的模型和机制,适用于许多用途。



通常使用非对称密码转移对称密码的会话密钥。即使只传输少量的数据,密码学家通常会喜欢使用对称密码发送加密的实际数据,并发送用非对称密码加密的密钥。一个巨大的好处是您可以向一百个不同的收件人发送消息,并且消息的大小将为O(消息的大小+ 100 * 2048位) - 您可以单独加密每个收件人的会话密钥,并且只传输一次消息。伟大的成功。



不对称密码也用于数字签名。虽然可以使用消息真实性的对称密码,但对称密码不能用于提供不可否认的签名



不对称密码对于加密少量随机或不可区分的随机数据(例如会话密钥和消息摘要。它最适用于键和散列。



对称密码通常比非对称密码快得多,但由于它们用于不同的目的,速度差异不是问题在实践中。当然,速度可以通过算法显着变化( DES 在软件中的速度很慢,可以快速硬件,但 AES 对我系统上的小型数据集来说是1.8到3.3倍,而且可能在硬件上还要快得多)。


OK I'm confused as how these two encryption methods work. I know that symmetric is conventional, and uses a shared private key between two users.

Basically, I want to know

  1. The principles of how they work

  2. Their purpose

  3. Their relative performance

of asymmetric and symmetric encryption methods.

解决方案

I suggest starting with Applied Cryptography. It's an excellent introduction to the principles involved in cryptography.

If you're seriously interested in cryptography, I strongly recommend the Handbook of Applied Cryptography as an amazing reference work. It will be too much to handle at first, but it is free, so go grab a copy now :) and when you're done with AC, read HAC. (Actually, the hardback edition is very well made and far easier to read than a few hundred pages of laser-printed paper; consider buying it if you like the looks of the PDFs.)

Symmetric encryption works by mixing secret input with a secret key in such a fashion that it is (a) fast (b) cannot derive the input or key from the output. The details of the mixing varies significantly, but there are block ciphers and stream ciphers; block ciphers work by looking at the input data in 8 or 16 or 32 byte blocks at a time, and diffusing the input and key within those blocks. Different modes of operation are needed to encrypt more data than fits in the blocks, and different modes of operation might or might not spread data between blocks too.

Symmetric ciphers are fantastic for bulk data encryption, from 8 bytes to 8 terabytes, it's the best choice for encrypting data.

Asymmetric encryption works by exploiting very difficult mathematical problems with back doors that enable a fast solution to the problem, if you have a small piece of very important data. The usual mathematical problems are factoring large numbers and discrete logarithms. Asymmetric algorithms work on a fixed data size, typically 1024-2048 bits for RSA and El Gamal, and 384 bits for Elliptic Curve versions of RSA or El Gamal. (Elliptic Curve versions use a different field than the integers for their computations. RSA and El Gamal and similar systems work with any field that specifies both a multiply and an add operation, and ECC has a different representation of that field that magically packs 'more' data into a bit. It's a super clever way of making well-known mechanisms fit into less memory, and my one-sentence introduction can't begin to do it justice. The simplicity is the amazing part.)

Asymmetric encryption helps solve the key distribution problem, but only barely: instead of requiring O(N^2) key pairs between every pair of people wanting to use cryptography to talk amongst themselves, it requires O(N) keys, one public/private pair per person, and everyone just needs to know everyone else's public portion. This is still not an easy problem, as the complexity of x509 demonstrates, but mechanisms such as openPGP and OpenSSH have simpler models and mechanisms that work well for many uses.

Asymmetric ciphers are usually used to transfer session keys for symmetric ciphers. Even when only a small amount of data is going to be transferred, cryptographers will typically prefer sending the actual data encrypted with a symmetric cipher, and send the key encrypted with an asymmetric cipher. One huge benefit is that you can send a message to a hundred different recipients, and the size of the message will be O(size of message + 100*2048 bits) -- you can encrypt the session key to each of the recipients individually, and only transfer the message once. Great Success.

Asymmetric ciphers are also used for digital signatures. While it is possible to use a symmetric cipher for message authenticity, a symmetric cipher cannot be used to provide non-repudiable signatures.

Asymmetric ciphers are fantastic for encrypting small amounts of random, or 'indistinguishable-from-random', data, such as session keys and message digests. It's best used for keys and hashes.

Symmetric ciphers are typically much faster than asymmetric ciphers, but because they are used for different purposes, the speed difference isn't an issue in practice. Of course, speeds can vary significantly by algorithm (DES is wickedly slow in software and can be fast in hardware, but AES is 1.8 to 3.3 times faster for small data sets on my system, and could probably be much faster still in hardware.)

这篇关于不对称和对称加密方法的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆