Select Page

Use Sage to answer the following questions. Show all your sage input/output:Suppose your RSA public key factors as p = 6569 and q = 8089, and the public exponent e is 11. Suppose you were sent the Ciphertext 28901722. Perform the RSA Decryption and recover the plaintext. Suppose that you want to encrypt the number 449 and send it to someone with public key N =37617577, and e = 529 Suppose that you forgot your public exponent, but you know that the prime factors of your Key’s modulus are 1723 and 5381 private exponent is 223. Find the public exponent. Use sage to generate an rsa public / private key pair and perform an encryption and decryption.
Use Sage to answer the following questions. Show all your sage input/output: Suppose your RSA public key factors as p = 6569 and q = 8089, and the public exponent e is 11. Suppose you were sent the Ci
Using Sage we can simulate an RSA Encryption and Decryption. sage: # randomly select some prime numbers sage: p = random_prime(1000); p 191 sage: q = random_prime(1000); q 601 sage: # compute the modulus sage: N = p*q sage: R = IntegerModRing(N) sage: phi_N = (p-1)*(q-1) sage: # we can choose the encrypt key to be anything sage: # relatively prime to phi_N sage: e = 17 sage: gcd(d, phi_N) sage: # the decrypt key is the multiplicative inverse sage: # of d mod phi_N sage: d = xgcd(d, phi_N) % phi_N sage: d 60353 sage: # Now we will encrypt/decrypt some random 7 digit numbers sage: P = randint(1,127); P 97 sage: # encrypt sage: C = R(P)^e; C 46685 sage: # decrypt sage: R(C)^d 97 sage: P = randint(1,127); P 46 sage: # encrypt sage: C = R(P)^e; C 75843 sage: # decrypt sage: R(C)^d 46 sage: P = randint(1,127); P sage: # encrypt sage: C = R(P)^e; C 288 sage: # decrypt sage: R(C)^d Also, Sage can just as easily do much larger numbers: sage: p = random_prime(1000000000); p 114750751 sage: q = random_prime(1000000000); q 8916569 sage: N = p*q sage: R = IntegerModRing(N) sage: phi_N = (p-1)*(q-1) sage: e = 2^16 + 1 sage: d = xgcd(e, phi_N) % phi_N sage: d 237150735093473 sage: P = randint(1,1000000); P 955802 sage: C = R(P)^e sage: R(C)^d 955802

#### Why Choose Us

• 100% non-plagiarized Papers
• Affordable Prices
• Any Paper, Urgency, and Subject
• Will complete your papers in 6 hours
• On-time Delivery
• Money-back and Privacy guarantees
• Unlimited Amendments upon request
• Satisfaction guarantee

#### How it Works

• Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
• Fill in your paper’s requirements in the "PAPER DETAILS" section.