Basic principles of RSA algorithm (RSA encryption and RSA digital signature)

Introduction
RSA algorithm is a very classic asymmetric algorithm. The so-called asymmetric encryption means that any person has two keys, a public key (others can know), and a private key (only you know ), under the premise of asymmetric encryption to ensure information security, symmetric encryption to encrypt information can greatly reduce the cost, compared with the same time in a fast and practical great convenience
RSA algorithm
RSA algorithm has two pairs The key, the public key is often recorded as (e, N), and the private key is often recorded as (d, N). Depending on the usage, RSA can be used to encrypt information or for digital signatures. The two usages have certain Symmetry

1:
Principle of using RSA algorithm to encrypt information : When B wants to send information to A, then B only needs to use A’s public key to encrypt the information to be sent, and then get the encrypted ciphertext, and A After getting the ciphertext, decrypt the ciphertext with the private key in your hand, you can restore the true information (that is, the plaintext) sent by B to A

The mathematical support of the RSA encryption algorithm is that the unidirectionality of Euler's function and the decomposition of large prime numbers are mathematically unsolvable problems. The specific mathematical foundation will be discussed in the next blog

Here we don’t pay attention to the underlying mathematical principles of the RSA algorithm. It can be simply understood from the application point of view as follows. The security of information transmission is important to the encryption of information using the RSA algorithm, that is, even if others get the ciphertext and the public key of the recipient of the information Without the key of the recipient of the information, it is also very difficult to crack the real plaintext information from the ciphertext, but if there is a private key, it becomes very simple to go from the ciphertext to the real plaintext information.

2:
Principle of digital signature using RSA algorithm : When A wants to send data to B and wants to perform a digital signature, A only needs to use its own private key to perform a digital signature algorithm on the data, and then a new signature data can be obtained , At this time, A needs to send both his original data and the newly obtained signature data to B. After B receives the signature data, it uses A’s public key to verify the signature data. The data that can be seen is sent to A Is the data exactly the same?

Here we also briefly understand the RSA algorithm for digital signature from the application point of view. It is different from using RSA for information encryption to ensure the safe transmission of information on the Internet. The following three points are important to using RSA for digital signature:
1: Prevent The information has been tampered with.
Note: If the data sent by A is tampered with by others when it is transmitted on the Internet, then B uses A’s public key to verify the signature data of A. The resulting data must be sent to A on the network. The incoming data is different, so that it can prevent the information from being tampered with

2: The verification information is sent by someone.
Note: This is determined by the mathematical theory of RSA. There is a certain mathematical relationship between public key data and private key data in RSA. When you use your own private key to sign the information When someone else uses your public key to verify the signature, they can get the same data as the message you sent, so as to verify who sent the message

3: Prevent the sender of information from denying that the information has been sent

Guess you like

Origin blog.csdn.net/jiyishizhe/article/details/105124918