<commit_before>"""
cryptography.py
Author: <NAME>
Credit: Avery, Ethan

Assignment:

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 = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;'\"/\\<>(){}[]-=_+?!")
let = []
other = []

def encrypt(P):
    key=input("Key: ")
    P=list(P)
    s=0
    p=[]
    for x in P:
        p.append(associations.find(x))
    print(p)
    k=[]
    for x in key:
        K.append((p[z]+K[z%len(K)]))
        z=z+1
    print(k)
    z=0
    C=[]
    while z>len(k):
        C.append(associations[k[z]])
        z=z+1
    print(C)
    
    
    for x in C:
        print(x,end="")
        print()


def decrypt(Z):
    key=input("Key: ")
    Z=list(Z)
    




id=input("Enter e to encrypt, d to decrypt, or q to quit: ")
if id not in('e', 'd', 'q'):
    print("Did not understand command, try again")
    id=input("Enter e to encrypt, d to decrypt, or q to quit: ")

if id == "e":
    message=str(input("Message: "))
    key=input("Key: ")
    l=len(message)
    k=len(key)
    for x in range(0, l):
        let.apend(associations.find(message[x])
    for y in range(0, k):
        let.apend(associations.find(message[y])
elif id=="d" :
    dcrpt=input("Message: ")
    key=str(input("Key: "))
elif id == "q" :
    print("Goodbye!")
'''<commit_msg>Updated from Brython Server: 3/4/2016 2:43:27 PM<commit_after>"""
cryptography.py
Author: <NAME>
Credit: Avery, Ethan

Assignment:

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 = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;'\"/\\<>(){}[]-=_+?!")
let = []
other = []

def encrypt(P):
    key=input("Key: ")
    P=list(P)
    s=0
    p=[]
    for x in P:
        p.append(associations.find(x))
    print(p)
    k=[]
    for x in key:
        K.append((p[z]+K[z%len(K)]))
        z=z+1
    print(k)
    z=0
    C=[]
    while z>len(k):
        C.append(associations[k[z]])
        z=z+1
    print(C)
    
    
    for x in C:
        print(x,end="")
        print()


def decrypt(Z):
    key=input("Key: ")
    Z=list(Z)
    




id=input("Enter e to encrypt, d to decrypt, or q to quit: ")
if id not in('e', 'd', 'q'):
    print("Did not understand command, try again")
    id=input("Enter e to encrypt, d to decrypt, or q to quit: ")
    if id == "e":
        message=str(input("Message: "))
        key=input("Key: ")
        l=len(message)
        k=len(key)
        for x in range(0, l):
            let.apend(associations.find(message[x])
        for y in range(0, k):
            let.apend(associations.find(message[y])
    elif id=="d" :
        dcrpt=input("Message: ")
        key=str(input("Key: "))
    elif id == "q" :
        print("Goodbye!")
'''
{'fraction_non_alphanumeric': 0.17573924731182797, 'fraction_numerical': 0.014448924731182795, 'mean_word_length': 2.6304878048780487, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '57508', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1146, 'n_words': 260}