Skip to content

Instantly share code, notes, and snippets.

@benrules2
Last active September 27, 2018 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benrules2/f8ebab2e32e0001aa6db0d4c6c5fc8e7 to your computer and use it in GitHub Desktop.
Save benrules2/f8ebab2e32e0001aa6db0d4c6c5fc8e7 to your computer and use it in GitHub Desktop.
Shift Cipher
class ShiftCipher:
[...]
import sys
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Not enough arguments, please provide e/d followed by the message")
N = 13
cipher = ShiftCipher(N)
if sys.argv[1] == "e":
message = cipher.encrypt_message(sys.argv[2])
print("Encrypted message: \n {}".format(message))
elif sys.argv[1] == "d":
message = cipher.decrypt_message(sys.argv[2])
print("Decrypted message: \n {}".format(message))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment