RSA information

xiaoxiao2021-03-06  55

1. Background:

The single key password With the expansion of the network size, the management of the key is a difficult point and cannot resolve the message confirmation problem.

In order to solve these problems. 1976 W. Diffie and M.E.heilinan proposed a new type of double key cryptographic system. Since the encryption and decryption of the two key cryptographic system is different, but only the encryption key is disclosed, it only needs to be confidentially decryled, so the key password does not have key management issues. One advantage of the key password is that there are new features such as digital signatures. In 1977, the RSA password system was proposed by RIVEST, SHAMIR and AD1EMAN, but the security of RSA has not been able to obtain theoretical proof.

2. Overview:

Public key encryption uses two keys - a public key and a private key, which are mathematically related. In order to be connected to a symmetric key, the public key is encrypted is sometimes called an asymmetric key encryption. In public key encryption, public keys can be publicly delivered between communication, or publish in public reserve, but related private keys are confidential. Only using private keys can decrypt data encrypted with public key. Data encrypted using private key can only be decrypted with public key (as shown below).

Since it is only a public key encrypted with a private key to restore, this is used in a digital signature.

3. Principle:

Generate a key:

1. Find two large numbers P, Q

2. Calculate n = p * q

3. Take a small odd number E and (P - 1) * (Q - 1)

4. Drafter D * E ≡ 1 (MOD N) D

5. E, N is the public key

6. d, n is a private key

encryption:

Set the message is m (

Decryption:

Set Ciphertext is C, it is M = C ^ D (MOD N)

signature:

If the information is m (

test:

The signature information is S, then the original information is m = s ^ e (MOD N)

Let's take an example:

If p = 3, q ​​= 7, then

n = p * q = 21

Encryption Key E and (P - 1) * (Q - 1) = 2 * 6 = 12 There is no common factor.

Select E, such as 5, then

D = 5-1 mod 12 = 5 equivalent to 1 = (E * D) MOD 12

Public E and N, confidential, discard P and Q.

Encryption message m = 4

C = m ^ e mod n = 4 ^ 5 mod 21 = 16

Decipong the message needs to perform the same index operation with the decryption key D. thus:

M = c ^ D mod n = 16 ^ 5 mod 21 = 4

4. Comparison of DES

DES

RSA

the way

symmetry

asymmetric

speed

fast

Slow 1000 times

Safety

general

high

verification

no

Yes

The amount of data

Big

Only used to encrypt key

Key management

complex

simple

转载请注明原文地址:https://www.9cbs.com/read-113970.html

New Post(0)