当前位置:网站首页>About RSA encryption and decryption principle
About RSA encryption and decryption principle
2022-06-13 08:40:00 【Array_ new】
Preface :
With the deepening of our study , Information security is becoming more and more important , The code we publish may contain our private information , For example, connect with Alipay sandbox api, When downloading some professional software, we need to input the public key and private key to verify our identity information , It is equivalent to unlocking with a key , The public key represents the lock , The private key represents the key to unlock , The public key and private key are interchangeable , Understand this , Let's talk about their principle in detail .
RSA Key distribution :
First take two prime numbers (p,q),N=pq
Then find their Euler function T = (p-1)(q-1)
Take out the public key E The rule is 1. It's a prime number .
2.1< Public key <T ;
3. No T Factor of
Public key selected E Then calculate the private key D (D*E)%T=1
This completes the distribution of public and private keys
for example p=3,q=11 N=pq=33
T=(3-1)(11-1)=20
Select a public key at random E=3 Then the key can be D=7
Public key E(3,33) Private key D(7,33)
According to the following encryption formula 1 2 3 Encrypted into
1,29,9
According to the decryption formula below, the original number is
1,2,3
Key encryption :( Plaintext ^E)%N= Ciphertext
Key decryption :( Ciphertext ^E)%N= Plaintext
RSA The principle of public key cryptography is : According to number theory , It's easier to find two large primes , But factoring their products is extremely difficult , Therefore, the product can be disclosed as the encryption key

result :

边栏推荐
- Call to undefined function think\captcha\imagettftext()
- JS to get the date in the next seven days of the current date
- HCIP_ MGRE experiment
- Dest0g3 520 orientation
- MySQL sorts according to the specified order of the specified fields
- JS wrapper object
- Using KVM to create three virtual machines that can communicate with local area network
- Namespace in TS (1)
- JS - simple ATM of the for cycle case
- Reverse order and comparison of strings
猜你喜欢

Buuctf web (V)

Document contains question type

Methods of importing and exporting settings in Altium Designer
![[notes] like the solution to the problem of slow query (index + explicitly specifying query fields)](/img/95/2109ddf1a0ff0223109eb9b5a02f00.jpg)
[notes] like the solution to the problem of slow query (index + explicitly specifying query fields)

Vscode define code block -- define cursor position

2021-04-16

容器概念和云原生

Svg text stroke effect

What software can be used to solve the problems faced by the auto parts industry

Buffer Overflow Vulnerability Lab
随机推荐
0. some doubts about learning SolidWorks for the first time
Buuctf web (III)
0. Quelques doutes au sujet de SolidWorks
How to modify desktop path in win10 system
How to download and install stm32cubemx
MySQL parsing serialized fields
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
Reverse order and comparison of strings
Numeric types in SQL. Try to avoid using null as the default value
DIY UAV (anonymous controller p2+f330 rack)
5、 Constant, variable
[notes] like the solution to the problem of slow query (index + explicitly specifying query fields)
Tmall product details interface, tmall product coupon interface, tmall API interface, tmall price monitoring interface, tmall price comparison interface, brand rights protection interface, tmall sales
Determination of ranking
Learning record 4:einops / / cudnn benchamark=true // hook
Several precise order receiving methods suitable for fresh food wholesale industry
Filebeat collects logs to elk
Is there any good management software to solve the problems faced by tea wholesalers
Explanation of JS event loop mechanism and asynchronous tasks
Four ways to install MySQL in Linux