Security Analysis of rsa Encryption Algorithm

1, RSA encryption principle:

1. Data.

The data is actually a byte string in the computer.

The encrypted data is divided into data blocks of a certain length, and each block is a bit string.

Think of this bit string as a binary integer - denoted by d

2. Key

The RSA algorithm is an asymmetric algorithm, so two keys are used:

One is the public key, used for encryption - denoted by e,

One is the private key, used for decryption - denoted by p.

In addition, you need to use an integer N, which is the base of the modulo operation in the algorithm.

In general, to ensure security, the key length should be above 1024-bit.

In short, e, p, N, these three data, determine a specific encryption and decryption activities.

Like the encrypted data d, e, p, and N are all integers.

e, N, are publicly available. And p is not open to the public.

3. Addition and decryption

a) encryption

c = d^e mod N /* d on the e-squared modulus N, get c, ie encrypted data */

b) decryption

d = c^p mod N /* c on the p-square square, get d, ie raw data */

4. Security

The security of the RSA algorithm is that e, p, and N are randomly generated.

Knowing e and N, and looking for p, is not feasible in calculation.

The question is, are the software tools we use really "random" when generating these random materials?

If the provider of the algorithm leaves behind what to do, or what preparations are made in advance, people see e and n, and maybe there is a way to get p.

2. Description of RSA encryption algorithm

The RSA algorithm is a public key cryptosystem encryption algorithm based on the elementary number theory theorem. The implementation process is as follows: select two large prime numbers p and q, then calculate n=pq, φ(n)=n-p-q+1, and then select A positive integer e, such that it satisfies (e, φ(n)) = 1, 1 "E "Φ(N); then find a positive integer D so that it satisfies 1 "D, and the key is. The plaintext message m satisfies 0≤m

For example, take two prime numbers p=11, q=13, and the product of p and q is n=p&TImes; q=143, and calculate φ(n)=np-q+1=120; then choose one and φ(n) The prime number, for example e=7, then the public key = n, e = 143, 7.

For this e value, the inverse can be calculated by the Euclidean expansion algorithm: d=103. Since e&TImes;d=7&TImes;103=721, e&TImes;d mod z =1 is satisfied; that is, 721 mod 120=1 holds. Then the secret key = n, d = 143, 103,

Let the sender need to send confidential information (plain text) m=85, the sender has obtained the public key n of the receiver from the public media, e=143,7, so the sender calculates the encrypted ciphertext c= me mod n =857 mod 143=123 and sent to the receiver.

After receiving the ciphertext c=123, the receiver calculates m= cd mod n =123103 mod 143=85 using the secret key that only he knows, so the receiver can get the real information sent by the sender to the m= 85, achieved decryption.

When encrypting with the RSA system, the plaintext is digitized and then encrypted. In practical applications, the length of the m value is generally much larger than the length of n. Therefore, when the message m is actually encrypted, it is first divided into data packets smaller than n (using binary Number, select the largest power of 2 less than n), and then encrypt and decrypt each group separately. For example, if p and q are chosen to be 100-bit prime numbers, then n will have 200 bits, and each data packet should be less than 200 bits long, but to ensure security, the length of each data should be as close as possible to the length of n.

Digital Signage

Digital Signage,Digital Menu Display,Digital Menu Board,Digital Signs For Businesses

Guangdong Elieken Electronic Technology Co.,Ltd. , https://www.elieken.com