Discrete logarithm can be calculated quickly in some special cases. However, there is usually no very effective way to calculate them. Several important algorithms in public key cryptography are based on the assumption that the solution of discrete logarithm problem has been found, and there is no efficient solution algorithm in carefully selected groups.
Diffie-Hellman is a method of establishing a key, not an encryption method. However, the key it generates can be used for encryption, further key management or any other encryption method. Diffie-Hellman key exchange algorithm and its optimization The first published public key algorithm appeared in the papers of Diffie and Hellman, which laid the foundation of public key cryptography.
The purpose of this key exchange technology is to enable two users to exchange secret keys safely for future message encryption. The effectiveness of Diffie-Hellman key exchange algorithm depends on the calculation difficulty of discrete logarithm.
From Wikipedia:
The simplest and earliest protocol uses the integer modular N multiplication group of prime number P and its original root G. The algorithm is as follows: green indicates non-secret information, and red bold indicates secret information.
Alice and Bob negotiate a group element at the same time, which can be used as a secret. And because of group multiplication.
Alice and Bob both got the same value in the end, because the sum in module P is equal ... Note that A, B and are secret. All other values -p, g and-can be transmitted on the common channel. Once Alice and Bob get the open secret, they can use it as the symmetric key of their encrypted communication, because only they can get it.
1984, T.Elgamal proposed a public key system based on discrete logarithm, which is an asymmetric encryption algorithm based on Diffie-Herman key exchange. ElGamal cryptosystem is applied in some technical standards, such as digital signature standard (DSS) and S/MIME e-mail standard. Like Diffie-Hellman, ElGamal's system users also choose a prime number Q, which is the prime number of Q.
ElGamal encryption algorithm consists of three parts: key generation, encryption and decryption.
The key generation steps are as follows:
Other users can encrypt through Alice's public key.
The encryption algorithm for encrypting message M with Alice's public key works as follows:
Alice decrypts it with her private key.
If information must be grouped and then sent in an encrypted sequence of key blocks, then each block must have a unique X (private key). If x is used for multiple blocks, the attacker will calculate other blocks by using information blocks.
The security of ElGamal is based on the difficulty of calculating discrete logarithm.
[1] Wikipedia editor. Diffie-Herman key exchange. Wikipedia, 2018 (20180503) [2018-05-03]. https://zh.wikipedia.org/w/index.php? Title =% E8% BF% AA% E8% 8F% B2-%E8% B5% AB% E7% 88% BE% E6% 9b% BC% E5% AF% 86% E9% 91%B0% E4% BA% A4%. oldid=49408565。
[2] Principles and Practice of Cryptography and Network Security by Stallings (6th edition).
[3] Wikipedia editor. ElGamal encryption algorithm [G/OL]. Wikipedia, 2016 (20161214) [2016-14] title = elgamal%. oldid=42453545。