Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the knowledge points of RSA algorithm

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the knowledge points of RSA algorithm". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the knowledge points of RSA algorithm"?

What is RSA?

In the previous article, we talked about AES algorithm. AES algorithm is a symmetric encryption algorithm. In this paper, we introduce a very commonly used asymmetric encryption algorithm RSA.

RSA applied for a patent for the RSA algorithm in 1983.

Encryption of RSA

The encryption of RSA can be expressed by the following formula:

Ciphertext = plaintext E mod N ciphertext = plaintext ^ E\ mod\ N ciphertext = plaintext E mod N

Simplicity is the best, which is probably why the RSA algorithm is so general.

If you know E and N, you can get the ciphertext, so we call the combination of E and N the public key.

How to choose E and N is a complex mathematical process, which we will talk about later.

Decryption of RSA

First, take a look at the formula for RSA decryption:

Plaintext = ciphertext D mod N plaintext\ =\ ciphertext ^ D\ mod\ N plaintext = ciphertext D mod N

Through the formula, we can see that the plaintext is obtained by the D power of the ciphertext and then taking the module N. Here N and encrypted N are the same number.

The combination of D and N is represented by the private key {DMagne N}.

The generation of NMagi Epene D

After knowing the principle of encryption and decryption of RSA, we will discuss how to generate the NMagnee D in the process of encryption and decryption.

The generation process is as follows:

1. Generate N

The formula for generating N is as follows:

Nipp ∗ Q N=p*q nimp ∗ Q

P and Q are two very large prime numbers, if it is too small, it is easy to be deciphered, and if it is too large, it will affect the speed of calculation. Usually the sizes of p and Q are 1024 bits. These two numbers are generated by a pseudorandom number generator.

two。 Find L

The calculation formula of L is as follows:

L=lcm (p − 1 for Q − 1) L=lcm (p − 1 for Q − 1) L=lcm (p − 1 for Q − 1)

L is the least common multiple of pMui 1 and Q Mel 1.

3. Find E

E is the public key used to encrypt. E is a number larger than 1 and smaller than L. And E and L must be prime. Only E and L are coprime to calculate D value.

1 < E < L 1 < E < L 1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report