Block overwrite #6

Merged
Hesham merged 2 commits from key-overwrite into master 2020-09-06 08:06:30 +02:00
Showing only changes of commit a864749812 - Show all commits

11
rsa.py
View File

@ -31,9 +31,14 @@ def main():
if sys.argv[1] == "gen" and len(sys.argv) == 4: ##rsa gen <keysize> <keyname> if sys.argv[1] == "gen" and len(sys.argv) == 4: ##rsa gen <keysize> <keyname>
keyFileName = sys.argv[3] keyFileName = sys.argv[3]
if keyExist(keyFileName): if keyExist(keyFileName):
##ask choice = input("overwrite key %s (y/n)" % keyFileName)
print("key already exists") if choice == "y":
sys.exit(0) key = generateKeys(keyFileName, int(sys.argv[2]))
elif choice == "n":
sys.exit(0)
else:
print("unrecognized choice!")
sys.exit(1)
else: else:
key = generateKeys(keyFileName, int(sys.argv[2])) key = generateKeys(keyFileName, int(sys.argv[2]))
print("e: ", key[E]) print("e: ", key[E])