Added help command

This commit is contained in:
HeshamTB 2020-04-20 00:19:09 +03:00
parent 23b421ee1f
commit 321fb3ec01
Signed by: Hesham
GPG Key ID: 74876157D199B09E

11
rsa.py
View File

@ -91,6 +91,8 @@ def main():
printKey(cracked_key)
if sys.argv[1] == "print": #rsa print <key>
printKey(readKeyFile(sys.argv[2]))
if sys.argv[1] == "help":
printHelp()
#No command exit code
exit(127)
@ -312,5 +314,14 @@ def crackKey2(keyName):
return key_cracked
else: continue
def printHelp():
print("commands:")
print("rsa gen <keysize> <keyname>")
print("rsa encrypt <message> <key> <signer>")
print("rsa decrypt \"<cipher>\" <key>")
print("rsa export <key>")
print("rsa crack <key>")
print("rsa print <key>")
if __name__ == "__main__":
main()