From ec2bbf116b820e2304f1762dbae0cff13e0e1814 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Wed, 19 Oct 2022 18:08:35 +0300 Subject: [PATCH] Improved output: - Print tested numbers as lines instead of using \r. - List command add more space for key name Signed-off-by: HeshamTB --- rsa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 rsa.py diff --git a/rsa.py b/rsa.py old mode 100644 new mode 100755 index 1629339..734ff8d --- a/rsa.py +++ b/rsa.py @@ -188,7 +188,7 @@ def getPrime(bits): while True: #Byte order "little" or "big" does not matter here since we want a random number from os.urandom() x = int.from_bytes(os.urandom(int(bits/8)), byteOrder) - print(x, end="") + print('Trying: ', x, end="\n") if mr.is_prime(x): print("\nprime: ", x) return x @@ -325,7 +325,7 @@ def listKeys(): if key[D] == 0: check = "".strip() else: check = '\u2713' - print("%7s%7s%7s-bit" % (key[ID].strip(), check, key[N].bit_length())) + print("%10s%7s%7s-bit" % (key[ID].strip(), check, key[N].bit_length())) def exportKey(keyFileName): key = readKeyFile(keyFileName)