banner

Blog

Asymmetric Cryptographic Algorithm: RSA Cryptographic Algorithm

27

August 14, 2024


RSA is an asymmetric cryptosystem, and its name is derived from the first letters of the surnames of its three inventors, Ron Rivest, Adi Shamir, and Leonard Adleman (Rivest-Shamir-Adleman). The RSA cryptographic algorithm uses two keys: PublicKey={e,N} and PrivateKey={d,N}. The security of RSA cryptographic algorithm is based on the difficulty of large integer decomposition. It has detailed encryption and decryption process (Figure 1).



Figure 1: The Encryption and Decryption Process of RSA Cryptographic Algorithm


In the encryption process of RSA cryptographic algorithm, the plaintext M is raised to e power. Then the result will be divided by N, and the remainder is ciphertext C. In the decryption process, divide by N and take the remainder to obtain the plaintext M.

The RSA cryptographic algorithm key is calculated as follows:


1) Choose two secret large prime numbers p and q.

2) To calculateN=p×q, φN=(p-1)(q-1). φN is the Euler function value of N.

3) Choose an integer e, such that 1N and gcd(φN,e )=1.

4) Compute private key to satisfy the congruence relation d∙e1 mod φN. d is the multiplicative inverse of e in model φN.

5) {e,N} is the public key and {d,N} is the private key.


In addition to data encryption and decryption, RSA cryptographic algorithm can also be used for data signature. There are specific implementation process of signature and verification (Figure 2).



Figure 2: Signature and Verification Process of RSA Cryptographic Algorithm



1) Institutional Parameter

The public key {e,N} and private key {d,N} are obtained according to the key calculation process of RSA algorithm.

2) Signature Process

If there is a massage M, its signature is: SM d mod N

3) Verification Process



After each other receives the message and signature S, they need to validate if M'S e mod N is formed or not. If formed, the signature is valid.


In practice, digital signature is generated by encrypting the message digest rather than directly encrypting the message.


As an international standard algorithm, RSA cryptographic algorithm is widely used in the fields of encrypted communication, digital signature, key exchange and many other areas. For security reasons, you are advised to select an RSA key of 2048 or higher in actual applications.

TOPIC:Cryptography Insight
27
More Blog

TOPIC:

MORE