Last active
September 27, 2018 11:39
-
-
Save benrules2/f8ebab2e32e0001aa6db0d4c6c5fc8e7 to your computer and use it in GitHub Desktop.
Shift Cipher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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