The difference between asymmetric and symmetric encryption methods?

OK. I am confused how these two encryption methods work. I know that symmetric is common and uses a shared private key between two users.

Basically, I want to know

  • Work principles.

  • Their purpose

  • Their relative performance

asymmetric and symmetric encryption methods.

+7
source share
2 answers

I suggest starting with Applied Cryptography . This is a great introduction to cryptography.

If you are seriously interested in cryptography, I highly recommend Handbook of Applied Cryptography as an amazing reference job. There will be too much at first, but it's free, so now grab a copy :) and when you are done with AC, read the HAC. (Actually, the hardcover is very well made and much easier to read than a few hundred pages of laser-printed paper, consider buying if you like the look of the PDF files.)

Symmetric encryption works by mixing secret input with a secret key in such a way that it (a) quickly (b) cannot infer an input or key from an output. Mixing details vary significantly, but there are block ciphers and stream ciphers ; block ciphers work by looking at the input in 8 or 16 or 32 byte blocks at a time, and scattering the input and key in these blocks. Different modes are needed to encrypt more data than fit in blocks, and different modes of operation may or may not distribute data between blocks.

Symmetric ciphers are fantastic for encrypting mass data, from 8 to 8 terabytes, this is the best choice for data encryption.

Asymmetric encryption works using very complex mathematical problems with the rear doors, which allow you to quickly solve the problem if you have a small piece of very important data. Common mathematical problems are factoring of large numbers and discrete logarithms . Asymmetric algorithms work with a fixed data size, usually 1024-2048 bits for RSA and El Gamal and 384 bits for an Elliptic curve of RSA or El Gamal versions. (Elliptic Curve versions use different fields than integers to calculate them. RSA and El Gamal and similar systems work with any field that defines both multiply and add operations, and ECC has a different view of this field that magically adds β€œmore” This is a very smart way to make well-known mechanisms fit into less memory, and my introduction to one sentence may not begin to do it fairly. Simplicity is an amazing part.)

Asymmetric encryption helps solve the key distribution problem, but only: instead of requiring an O (N ^ 2) key pair between each pair, people who want to use cryptography to talk to each other require O (N) keys, one public / private couple per person, and everyone just needs to know all the other public parts. This is still not an easy task, as the complexity of x509 is demonstrated, but mechanisms such as openPGP and OpenSSH have simpler models and mechanisms that work well for many purposes.

Asymmetric ciphers are commonly used to transmit session keys for symmetric ciphers. Even when only a small amount of data is transmitted, cryptographers usually prefer to send the actual data encrypted using a symmetric cipher and send a key encrypted using asymmetric encryption. One huge advantage is that you can send a message to several recipients, and the message size will be O (message size + 100 * 2048 bits) - you can encrypt the session key to each of the recipients individually, and only send the message once. Big success.

Asymmetric ciphers are also used for digital signatures . Although you can use a symmetric cipher to authenticate a message , a symmetric cipher cannot be used to provide non-denying signatures .

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

Symmetric ciphers are usually much faster than asymmetric ciphers, but since they are used for different purposes, the difference in speed is not a problem in practice. Of course, the speeds can vary significantly according to the algorithm ( DES viciously slows down in software and can be fast in hardware, but AES is 1.8-3.3 times faster for small data sets in my system and probably can be much faster in hardware.)

+19
source

Summary:

Symmetric ciphers: Faster than asymmetric ciphers, but one key is required, which must be shared between the sender and receiver. Obtaining this key by both parties in safe mode is in itself a non-trivial problem.

Asymmetric Ciphers: Slower, but solves the key distribution problem using two keys, one of which is great for sharing.

In practice, they can be combined to get the best of both worlds (e.g. HTTPS).

+19
source

All Articles