Asymmetric Key Cryptography Overview
Asymmetric Key Cryptography Overview
The RSA cryptosystem is preferred for public-key encryption due to its mathematical foundation based on the difficulty of factoring large composite numbers. This problem is computationally intensive, offering a high level of security as breaking the encryption would require an infeasible amount of computational power to factor the large modulus n . Additionally, the algorithm's flexibility in key size allows for scalable security levels, enhancing its applicability in various security contexts .
The RSA algorithm ensures secure communication by using a public key for encryption and a private key for decryption. The public key, which consists of a modulus n (product of two large primes, p and q) and an exponent e, is used to encrypt messages . Only the intended recipient has access to the private key, determined by the decryption exponent d, which is the modular inverse of e mod (n).
A potential vulnerability of the RSA algorithm is its susceptibility to attacks if the same modulus n is used across different systems or instances. This can allow attackers to leverage mathematical relationships between the public keys and perform modulus attacks . One recommendation to mitigate this vulnerability is to ensure that each user's key pair uses distinct prime factors p and q to produce a unique modulus n .
Asymmetric key cryptography uses two separate keys: one private and one public, whereas symmetric key cryptography uses a single key for both encryption and decryption . In asymmetric cryptography, plaintext and ciphertext are treated as integers, contrasting with symmetric cryptography where the representation can vary .
In the RSA encryption process, the sender first converts the plaintext into an integer. Using the recipient's public key (e, n), the sender calculates the ciphertext C = P^e mod n, where P is the plaintext as an integer. For decryption, the recipient uses their private key d to compute the plaintext P = C^d mod n . For example, if p = 7, q = 11, and n = 77, with public key e = 13 and private key d = 37 (where e \* d mod 60 = 1), encrypting plaintext 5 gives ciphertext C = 5^13 mod 77, while decryption involves calculating P = C^37 mod 77 .
Large prime numbers are crucial in the RSA cryptosystem because they form the basis of the modulus n, which is used in the encryption and decryption processes . The security of RSA is heavily reliant on the difficulty of factoring this modulus into its prime components. If the primes were small or easily factorable, attackers could efficiently reverse-engineer the private key, compromising the encryption .
The RSA cryptosystem facilitates secure communication over an insecure channel by allowing the sender to encrypt the message with the recipient's public key, ensuring that only the recipient can decrypt it using their private key . This method ensures confidentiality as only the intended recipient has the means (private key) to reverse the encryption process . The separation of keys ensures that even if the public key and ciphertext are intercepted, the message remains secure .
When choosing exponents in RSA key generation, it is important that the public exponent e and the private exponent d are multiplicative inverses mod (n), ensuring that e \* d mod (n) = 1 . A common choice for e is 65537, which simplifies calculations and provides good security. However, e must be coprime to (n). The private exponent d should be large enough to prevent certain attacks but not so large that decryption becomes computationally burdensome .
The RSA cryptosystem uses Optimal Asymmetric Encryption Padding (OAEP) to enhance security by embedding randomness in the messages before encryption. Padding is necessary because it prevents attackers from exploiting predictable structures in the plaintext, thereby thwarting attacks that employ chosen plaintexts or exploit deterministic encryption properties .
In RSA character encoding, each character is typically assigned a numeric value and concatenated to form a larger integer for encryption. For instance, Ted sends the message 'NO' to Jennifer by encoding N as 13 and O as 14, resulting in the plaintext 1314 . Jennifer's public key, consisting of n = 159197 and e = 343, is used for encryption, and Ted computes the ciphertext by raising 1314 to the power of 343 modulo 159197. Jennifer then decrypts the ciphertext using her private key d = 12007 .