Contents

Encrypting
Decrypting
Attack -- factorize
Attack -- chosen-plaintext
Bad inputs from which the program can recover

Encrypting

Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 1
Enter your text to encrypt with RSA.
No fancy characters, including accents.
Pressing a carriage return will begin encryption.
Hi, this is something to encrypt.
Encrypting ...
Your ciphertext is as follows:
11326689924953717018376390618376390630218561909154541513627840221587282503288848
5203353831010831351
Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 1
Enter your text to encrypt with RSA.
No fancy characters, including accents.
Pressing a carriage return will begin encryption.
When the message is too short/long, it's padded with pound signs.
Encrypting ...
Your ciphertext is as follows:
12211946621689374836503366708628530125452864004281058320317873933550727310056039
70310964981384862071021788500903296663231689410995319981966266772635024241856226
68157498875209337533350338198174691325

Decrypting

Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 2
Enter your text to decrypt with RSA.
Enter the large integer to decrypt.
Pressing a carriage return will begin decryption.
11326689924953717018376390618376390630218561909154541513627840221587282503288848
5203353831010831351
Decrypting ...
Pound signs at the end may not have been part of the original message.
Your plaintext is as follows:
Hi, this is something to encrypt.
Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 2
Enter your text to decrypt with RSA.
Enter the large integer to decrypt.
Pressing a carriage return will begin decryption.
12211946621689374836503366708628530125452864004281058320317873933550727310056039
70310964981384862071021788500903296663231689410995319981966266772635024241856226
68157498875209337533350338198174691325
Decrypting ...
Pound signs at the end may not have been part of the original message.
Your plaintext is as follows:
When the message is too short/long, it's padded with pound signs.#

Attack -- factorize

Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 3

   Enter 1 to try to factor the semiprime using Pollard's p - 1 factorization
      algorithm.
   Enter 2 to discover the plaintext of one 9-long segment using a chosen 
      plaintext attack.
   Or, enter 0 to go back to the main menu.
   Choose your attack method: 1
   131071
   is a divisor of the semiprime.

   Enter 1 to try to factor the semiprime using Pollard's p - 1 factorization
      algorithm.
   Enter 2 to discover the plaintext of one 9-long segment using a chosen 
      plaintext attack.
   Or, enter 0 to go back to the main menu.
   Choose your attack method: 0

Attack -- chosen-plaintext

Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 3

   Enter 1 to try to factor the semiprime using Pollard's p - 1 factorization
      algorithm.
   Enter 2 to discover the plaintext of one 9-long segment using a chosen 
      plaintext attack.
   Or, enter 0 to go back to the main menu.
   Choose your attack method: 2

   Enter the 9-digit integer: 122119466

   The plaintext was: Whe

   Enter 1 to try to factor the semiprime using Pollard's p - 1 factorization
      algorithm.
   Enter 2 to discover the plaintext of one 9-long segment using a chosen 
      plaintext attack.
   Or, enter 0 to go back to the main menu.
   Choose your attack method: 2

   Enter the 9-digit integer: 216893748

   The plaintext was: n t

Bad inputs from which the program can recover

   Enter 1 to try to factor the semiprime using Pollard's p - 1 factorization
      algorithm.
   Enter 2 to discover the plaintext of one 9-long segment using a chosen 
      plaintext attack.
   Or, enter 0 to go back to the main menu.
   Choose your attack method: Hi
This takes only integers.


Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: splat


Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 124


Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 
12211946621689374836503366708628530125452864004281058320317873933550727310056039
70310964981384862071021788500903296663231689410995319981966266772635024241856226
68157498875209337533350338198174691325

Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 2
Enter your text to decrypt with RSA.
Enter the large integer to decrypt.
Pressing a carriage return will begin decryption.
1234567
Incorrect input length for this key.


Enter 3 to try to break a cipher.
Enter 2 to decrypt using the existing key.
Enter 1 to encrypt using the existing key.
Enter 0 to quit.
Your selection: 2
Enter your text to decrypt with RSA.
Enter the large integer to decrypt.
Pressing a carriage return will begin decryption.
splat, 2
Incorrect input length for this key.
[]$