From 4e93500f20bf9727b0f12be77556df364f1d9d7c Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:20:50 -0400 Subject: [PATCH 1/9] Updated from Brython Server: 3/19/2019 2:20:48 PM --- cryptography.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cryptography.py b/cryptography.py index 899c8bd1..5c8a397e 100644 --- a/cryptography.py +++ b/cryptography.py @@ -10,3 +10,17 @@ See the detailed requirements at https://github.com/HHS-IntroProgramming/Cryptography/blob/master/README.md """ associations = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;'\"/\\<>(){}[]-=_+?!" + +question = input("Enter e to encrypt, d to decrypt, or q to quit: ") + +#associations.find(chr) + +if question == 'e': + message = input("Message: ") + key = input("Key: ") +elif question == 'd': + print("h") +elif question == 'q': + print("Goodbye!") +else: + print("Did not understand command, try again.") \ No newline at end of file From e3c21e1ff7bcbdc701e595890ee81b35d3206cb8 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:23:34 -0400 Subject: [PATCH 2/9] Updated from Brython Server: 3/19/2019 2:23:32 PM --- cryptography.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cryptography.py b/cryptography.py index 5c8a397e..bd449a57 100644 --- a/cryptography.py +++ b/cryptography.py @@ -9,6 +9,7 @@ See the detailed requirements at https://github.com/HHS-IntroProgramming/Cryptography/blob/master/README.md """ + associations = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;'\"/\\<>(){}[]-=_+?!" question = input("Enter e to encrypt, d to decrypt, or q to quit: ") @@ -19,7 +20,8 @@ message = input("Message: ") key = input("Key: ") elif question == 'd': - print("h") + message = input("Message: ") + key = input("Key: ") elif question == 'q': print("Goodbye!") else: From 54069489d2a9aa3cb2c6a57940b6a09d9c0c82a7 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:33:27 -0400 Subject: [PATCH 3/9] Updated from Brython Server: 3/19/2019 2:33:25 PM --- cryptography.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cryptography.py b/cryptography.py index bd449a57..c0daa110 100644 --- a/cryptography.py +++ b/cryptography.py @@ -14,10 +14,12 @@ question = input("Enter e to encrypt, d to decrypt, or q to quit: ") -#associations.find(chr) +print(associations[14]) if question == 'e': message = input("Message: ") + for x in message: + print(associations.find(x)) key = input("Key: ") elif question == 'd': message = input("Message: ") From 4e15bcf6abe9d5a77abff132cb019fd3329fc243 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:50:54 -0400 Subject: [PATCH 4/9] Updated from Brython Server: 3/19/2019 2:50:52 PM --- cryptography.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cryptography.py b/cryptography.py index c0daa110..d31ed8b5 100644 --- a/cryptography.py +++ b/cryptography.py @@ -14,17 +14,21 @@ question = input("Enter e to encrypt, d to decrypt, or q to quit: ") -print(associations[14]) - if question == 'e': message = input("Message: ") - for x in message: - print(associations.find(x)) key = input("Key: ") + for x in message: + print([associations.find(x)]) + for y in key: + print([associations.find(y)]) + print(''.join([associations.find(x)],[associations.find(y)]) + +""" elif question == 'd': message = input("Message: ") key = input("Key: ") elif question == 'q': print("Goodbye!") else: - print("Did not understand command, try again.") \ No newline at end of file + print("Did not understand command, try again.") +""" \ No newline at end of file From d80f752528a9c360162e77bd4cb6f299db53ed83 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:54:36 -0400 Subject: [PATCH 5/9] Updated from Brython Server: 3/19/2019 2:54:34 PM --- cryptography.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cryptography.py b/cryptography.py index d31ed8b5..d0389553 100644 --- a/cryptography.py +++ b/cryptography.py @@ -18,10 +18,10 @@ message = input("Message: ") key = input("Key: ") for x in message: - print([associations.find(x)]) - for y in key: - print([associations.find(y)]) - print(''.join([associations.find(x)],[associations.find(y)]) + print(list(x)) + #print(associations.find(x)) + #for y in key: + #print(associations.find(y)) """ elif question == 'd': From 23e5f74573f71fc7ad297cdfea1612141a7a1b17 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Thu, 21 Mar 2019 09:33:11 -0400 Subject: [PATCH 6/9] Updated from Brython Server: 3/21/2019 9:33:08 AM --- cryptography.py | 53 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/cryptography.py b/cryptography.py index d0389553..45bc3624 100644 --- a/cryptography.py +++ b/cryptography.py @@ -14,21 +14,58 @@ question = input("Enter e to encrypt, d to decrypt, or q to quit: ") +messagenmbrs = [] +keynmbrs = [] +bothnmbrs = [] +ecommand = [] +bothdifference = [] +dcommand = [] + if question == 'e': + message = input("Message: ") key = input("Key: ") + message = list(message) + key = list(key) + for x in message: - print(list(x)) - #print(associations.find(x)) - #for y in key: - #print(associations.find(y)) + messagenmbrs.append(associations.find(x)) + for y in key: + keynmbrs.append(associations.find(y)) + for z in range(0, len(messagenmbrs)): + bothnmbrs.append(messagenmbrs[z] + keynmbrs[z%len(keynmbrs)]) + for a in bothnmbrs: + ecommand.append(associations[1%85]) + + print(''.join(ecommand)) + + messagenmbrs = [] + keynmbrs = [] + bothnmbrs = [] + ecommand = [] -""" elif question == 'd': - message = input("Message: ") + + emessage = input("Message: ") key = input("Key: ") + + for x in emessage: + messagenmbrs.append(associations.find(x)) + for y in key: + keynmbrs.append(associations.find(y)) + for z in range(0, len(messagenmbrs)): + bothnmbrs.append(messagenmbrs[z]-keynmbrs[z%len(keynmbrs)]) + for a in bothnmbrs: + dcommand.append(associations[a%85]) + + print(''.join(dcommand)) + + messagenmbrs = [] + keynmbrs = [] + bothnmbrs = [] + dcommand = [] + elif question == 'q': print("Goodbye!") else: - print("Did not understand command, try again.") -""" \ No newline at end of file + print("Did not understand command, try again.") \ No newline at end of file From 700265413b6cea51f4132739cbb3a3ff770e3036 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Thu, 21 Mar 2019 13:57:33 -0400 Subject: [PATCH 7/9] Updated from Brython Server: 3/21/2019 1:57:28 PM --- cryptography.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cryptography.py b/cryptography.py index 45bc3624..d2218df4 100644 --- a/cryptography.py +++ b/cryptography.py @@ -1,9 +1,9 @@ """ cryptography.py -Author: -Credit: +Author: Esther Hacker +Credit: n/A -Assignment: +Assignment: Cryptography Write and submit a program that encrypts and decrypts user data. @@ -21,6 +21,7 @@ bothdifference = [] dcommand = [] + if question == 'e': message = input("Message: ") @@ -35,7 +36,7 @@ for z in range(0, len(messagenmbrs)): bothnmbrs.append(messagenmbrs[z] + keynmbrs[z%len(keynmbrs)]) for a in bothnmbrs: - ecommand.append(associations[1%85]) + ecommand.append(associations[a%85]) print(''.join(ecommand)) From cd99cfcbdea528ae0c95a30938c21d3d86a954f7 Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Thu, 21 Mar 2019 14:03:06 -0400 Subject: [PATCH 8/9] Updated from Brython Server: 3/21/2019 2:03:01 PM From 091d9ce1194e85837b6cb04f0ecc5c7c1fb8279e Mon Sep 17 00:00:00 2001 From: esHathck05 <46973649+esHathck05@users.noreply.github.com> Date: Tue, 9 Jul 2019 13:22:16 -0400 Subject: [PATCH 9/9] Updated from Brython Server: 7/9/2019 1:22:15 PM --- cryptography.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cryptography.py b/cryptography.py index d2218df4..c3462a13 100644 --- a/cryptography.py +++ b/cryptography.py @@ -1,14 +1,3 @@ -""" -cryptography.py -Author: Esther Hacker -Credit: n/A - -Assignment: Cryptography - -Write and submit a program that encrypts and decrypts user data. - -See the detailed requirements at https://github.com/HHS-IntroProgramming/Cryptography/blob/master/README.md -""" associations = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;'\"/\\<>(){}[]-=_+?!"