Double Key Encryption System
How to say
I didn't find where the public key encryption is, so I continued to write.
Public key encryption, also known as asymmetric (key) encryption, belongs to the second-level discipline of network security under communication technology, and refers to encryption composed of a corresponding pair of unique keys (that is, a public key and a private key). method. It solves the issue of key release and management, and is the core of commercial cryptography. In the public key encryption system, what is not disclosed is the private key, and what is disclosed is the public key.
Below, three and one will show you the public key encryption process. As shown below.
Asymmetric encryption and decryption process:
The receiver of the message prepares the public key and private key
The receiver keeps the private key and publishes the public key to the message sender
The message sender encrypts the message with the receiver's public key
The recipient of the message decrypts the message with his own private key
Euclidean Algorithm Inversion
arithmetic
As an example, find the inverse of 17 modulo 26.
17x=1 mod 26
26=1×17+9,17=9+8,9=8×1+1
1=9-8=2×9-17=2×26-3×17..17-1 against 26=-3=23 against 26
formula
Find the inverse of x under mod x+x+x+x+1
First we need to prove that x2 and
Greatest common divisor of mod x+x+x+x+1
is 1, otherwise this inverse element does not exist.
28+x4+x+x+1=(2°+x+x)x+x+1x2=x(x+1)-x
x+1=(-1)(-x)+1
Push it down:
1=(x+1)-x
-x=x2-x(x+1).1=(1-x)(1+x)+a2(1+x)=28+x4+x+x+1-(x°+x2+x)z2
..1=(1-x)[25+x+2+x+1-(x5+a2+x)2+a2
=(1-x)(x8+x4+x3+x+1)+(x7-25+x3-x+1)x2
The inverse of ..a under modax8+x+x+x+1 is (x7
-x5+x3-x+1)
RSA algorithm
Encryption and decryption process
Choose a pair of unequal large prime numbers, denoted as p, q
Calculate N=p×q
Calculate (N)=(p-1)×(g-1)
Choose an integer e that is relatively prime to (N)
Calculate the inverse element d of e for middle (N)
Public key KU=(e, N), private key KR=(d, N) Note that the brackets are not the greatest common divisor, but the expression form, see the example for details!
If two positive integers e and middle(n) are relatively prime, then an integer d must be found such that ed-1 is divisible by middle(n), or the remainder obtained by dividing ed by middle(n) is 1. At this time, d is called the inverse element of e.
Encrypt Me mod N=C
Decrypt Cd modN=M
example
Diffie-Hellman key exchange algorithm
Fundamental