Encryption and Decription of a Text Using Rivest-Shamir-Adleman Algorithm

slcfw4571 31 views 16 slides Sep 13, 2024
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

RSA (Rivest-Shamir-Adleman) is one of the most widely used encryption algorithms in modern computing, named after its inventors Ron Rivest, Adi Shamir, and Leonard Adleman. It operates on the principle of public-key cryptography, which involves two distinct keys: a public key for encryption and a pr...


Slide Content

T3 Assessment Batch - 16 Cryptography & Network Security 211FA04571 211FA04154 211FA04314 211FA04342

Table of Contents 1 Understanding RSA: The steps involved Encryption and Decryption 2 Public and Private Key Usage in RSA 3 Encoding and Decoding RSA Key Generation 4 Solving RSA in the given Question 5 Strengths and Weakness of RSA 6 Create a new encryption system Using RSA algorithm 7 Combines With another Encryption technique 8 Conclusion

Understanding RSA : The steps involved Encryption and Decryption Key Generation Choose two large prime numbers p and q. Compute n = p * q. Compute the totient function φ(n) = (p - 1) * (q - 1). Choose an integer e such that 1 < e < φ(n) and gcd (e, φ(n)) = 1; e is the public exponent. Compute the private exponent d such that d * e ≡ 1 (mod φ(n)). The public key is (e, n) and the private key is (d, n). Encryption Convert the message M into an integer such that 0 ≤ M < n. Compute the cipher-text C using the public key: C = M^e mod n. Decryption Compute the plaintext M using the private key: M = C^d mod n.

Public and Private Key Usage in RSA Encryption The sender uses the recipient's public key (e, n) to encrypt the message. This ensures that only the recipient, who possesses the corresponding private key (d, n), can decrypt the message. Decryption The recipient uses their private key to decrypt the message. Since only the recipient knows the private key, this ensures the confidentiality of the communication. Summary The sender encrypts the message using the recipient’s public key (e,n) The recipient decrypts the message using their private key (d,n) This process ensures confidentiality, as only the intended recipient can decode the message.

Benefits and Drawbacks of Key Pair Usage Benefits of Key Pair Usage Drawbacks of Key Pair Usage RSA key pairs enhance security by providing unique keys for encryption and decryption, ensuring confidentiality of messages. The use of public keys allows for secure communication without sharing private keys, reducing risk of unauthorized access. RSA's key pair mechanism supports digital signatures, enhancing authenticity and integrity of the messages exchanged. Key management can be complex, requiring strict protocols to ensure secure generation and storage of the keys. If a private key is compromised, all communications secured with that key become vulnerable to interception. RSA performance can degrade with large data sizes, necessitating efficient use of hybrid encryption strategies.

Solving RSA Examples Example-01 P = 3, Q = 7, E = 5, M = 10 Key Generation: n = 3 * 7 = 21 φ(n) = (3 - 1) * (7 - 1) = 2 * 6 = 12 e = 5, which is co-prime with 12. Computed such that d * 5 ≡ 1 (mod 12). The value of d is 5 (since 5 * 5 = 25, and 25 mod 12 = 1). Public Key: (e = 5, n = 21), Private Key: (d = 5, n = 21). Encryption C = M^e mod n = 10^5 mod 21 = 100000 mod 21 = 16. Cipher-text C = 16. Decryption M = C^d mod n = 16^5 mod 21 = 1048576 mod 21 = 10. Decrypted message M = 10.

Example-02 P = 17, Q = 23, E = 9, M = 7 Key Generation: n = 17 * 23 = 391 φ(n) = (17 - 1) * (23 - 1) = 16 * 22 = 352 E = 9, which is co-prime with 352. Computed such that d * 5 ≡ 1 (mod 12). The value of d is 313 Public Key: (e = 9, n = 391, Private Key: (d = 313, n = 391). Encryption C = M^e mod n = 7^9 mod 391 = 40353603 mod 391 = 205. Cipher-text C = 205. Decryption M = C^d mod n = 205^313 mod 391 = 7. Decrypted message M = 10.

Example-03 Given : e = 13, n = 77 The prime factors of n = 77 are p = 7 and q = 11. Compute φ(n) = (7 - 1) * (11 - 1) = 6 * 10 = 60. Computed such that d * 13 ≡ 1 (mod 60). The value of d is 37. Private Key : (d = 37, n = 77 ). Decryption M = C^d mod n = 20^37 mod 77 = 9. The plaintext M is 9.

Unlocking Secrets RSA decryption is a crucial process that transforms ciphertext into plaintext using the private key. Understanding this mechanism is vital for secure communications and data protection. In the RSA algorithm, decryption involves modular exponentiation with the private key. The operation is performed on the ciphertext to retrieve the original message in plaintext form. To perform RSA decryption, ensure you have the correct private key corresponding to the public key used for encryption. The decryption formula is M = C^d mod n, where M is the plaintext. Learning RSA decryption equips you with the necessary skills to handle secure data transmissions effectively. It’s essential for cybersecurity and protecting sensitive information from unauthorized access.

Strengths of RSA RSA is renowned for its high security level, leveraging large prime numbers to create strong encryption. This makes unauthorized data access nearly impossible, ideal for sensitive communications. One significant advantage of RSA is its ease of key distribution. Since the public key can be shared openly, users can securely communicate without prior arrangements, enhancing flexibility. RSA's robustness against various attacks, such as factorization attacks, ensures ongoing data integrity. This reliability fosters trust in digital signatures and secure transactions across platforms. Furthermore, RSA supports digital signatures, enabling verification of message authenticity. This feature is crucial in maintaining confidentiality and integrity in digital communications.

Weaknesses of RSA Vulnerabilities of RSA Limitations of RSA RSA's key length can be susceptible to advancements in computational power, making it easier to break over time. The security of RSA relies heavily on the difficulty of factoring large primes, which may be compromised by future algorithms. RSA is slower than newer algorithms like elliptic curve cryptography, affecting performance in large-scale applications. RSA requires significantly larger keys than modern encryption methods, complicating key management and storage. The algorithm is less efficient for encrypting large messages, necessitating hybrid encryption methods that add complexity. As quantum computing evolves, RSA's reliance on integer factorization may make it obsolete, posing a significant risk.

Encryption system that combines the RSA algorithm with the Caesar cipher Let's create a new encryption system that combines the RSA algorithm with the Caesar cipher . Here's how this hybrid system will work, Hybrid RSA and Caesar Cipher Encryption System Key Generation (RSA) : Each user generates a public and private RSA key pair . The Caesar cipher key will be encrypted using RSA. Symmetric Encryption (Caesar Cipher) : The message is encrypted using a Ca caesar cipher with a random shift value (key). The Caesar cipher shift key is then encrypted using RSA. Steps : Choose a Caesar cipher shift key (e.g., shift of 3). Encrypt the message using the Caesar cipher. Encrypt the Caesar cipher shift key using RSA public key encryption.

Encryption Example: Message : "DECLARE WAR" Caesar cipher shift key : 3 RSA public key : Assume a small public key (e, n) = (3, 55) Step 1: Encrypt "DECLARE WAR" using the Caesar Cipher Using a Caesar cipher with a shift of 3 D → G , E → H , C → F , L → O , A → D , R → U , E → H , W → Z , A → D , R → U The Caesar-encrypted message is “GHFODUH ZDU" Step 2: Encrypt the Caesar Cipher Shift Key (3) using RSA Let’s assume the public RSA key is e = 3 , n=55 (for simplicity). Using RSA encryption formula C = M^e mod n M=3 (Caesar cipher shift key ) C = 3^3 mod 55 = 27 The encrypted Caesar cipher shift key is 27 .

Final Ciphertext: Caesar-encrypted message : "GHFODUH ZDU" RSA-encrypted Caesar cipher shift key : 27 So, the final cipher text is, "GHFODUH ZDU" (message) 27 (encrypted Caesar cipher key) This system uses RSA to securely transmit the Caesar cipher shift key and uses Caesar cipher for the actual message encryption.

Conclusion 01 02 03 04 What is RSA? New Hybrid Method Enhanced Security Future of Encryption RSA or Rivest-Shamir-Adleman, is a widely used public key encryption technique that secures sensitive data transmissions. The new hybrid method combines RSA with symmetric encryption techniques like AES. This synergy leverages RSA’s key exchange. By integrating RSA with innovative techniques, we achieve a multi-layered encryption approach. This enhances security, making it harder. The future of encryption lies in adaptive systems that incorporate new technologies and methodologies. As threats evolve.
Tags