Print out n, e, d after key gen.

This commit is contained in:
HeshamTB 2020-04-20 21:20:34 +03:00
parent 321fb3ec01
commit c351efa716
Signed by: Hesham
GPG Key ID: 74876157D199B09E

5
rsa.py
View File

@ -31,6 +31,9 @@ def main():
if sys.argv[1] == "gen": ##rsa gen <keysize> <keyname> if sys.argv[1] == "gen": ##rsa gen <keysize> <keyname>
keyFileName = sys.argv[3] keyFileName = sys.argv[3]
key = generateKeys(keyFileName, int(sys.argv[2])) key = generateKeys(keyFileName, int(sys.argv[2]))
print("e: ", key[E])
print("n: ", key[N])
print("d: ", key[D])
printKey(key) printKey(key)
try: try:
saveKeyFile(key, keyFileName) saveKeyFile(key, keyFileName)
@ -324,4 +327,4 @@ def printHelp():
print("rsa print <key>") print("rsa print <key>")
if __name__ == "__main__": if __name__ == "__main__":
main() main()