
#Dont run this. DONT.
def key(string, key):
    s = ""; i = 0 
    while(len(s) != len(string)):
        s += key[i%len(key)]
        i+=1
    return s

#Just run this for cipher.
def encrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string,key1)
    cipher = ""
    for i in range(len(key_)):
        if(string[i] != ' '):
            p = (ord(string[i]) + ord(key_[i]))%26
            p += ord('A')
            cipher += chr(p)
        else:
            cipher += ' '
    return cipher
#Run to decipher. 
def decrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    res = ""
    for i in range(len(string)):
        if(string[i] != ' '):
            p = (ord(string[i]) - ord(key_[i]) + 26)%26
            p += ord('A')
            res += chr(p)
        else:
            res += ' '
    return res




c41bbc8a0bf4e38e2c4a31459e26a90f6de905fb
<mask token>

<mask token>


def encrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    cipher = ''
    for i in range(len(key_)):
        if string[i] != ' ':
            p = (ord(string[i]) + ord(key_[i])) % 26
            p += ord('A')
            cipher += chr(p)
        else:
            cipher += ' '
    return cipher


<mask token>

<mask token>


def encrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    cipher = ''
    for i in range(len(key_)):
        if string[i] != ' ':
            p = (ord(string[i]) + ord(key_[i])) % 26
            p += ord('A')
            cipher += chr(p)
        else:
            cipher += ' '
    return cipher


def decrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    res = ''
    for i in range(len(string)):
        if string[i] != ' ':
            p = (ord(string[i]) - ord(key_[i]) + 26) % 26
            p += ord('A')
            res += chr(p)
        else:
            res += ' '
    return res

def key(string, key):
    s = ''
    i = 0
    while len(s) != len(string):
        s += key[i % len(key)]
        i += 1
    return s


def encrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    cipher = ''
    for i in range(len(key_)):
        if string[i] != ' ':
            p = (ord(string[i]) + ord(key_[i])) % 26
            p += ord('A')
            cipher += chr(p)
        else:
            cipher += ' '
    return cipher


def decrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    res = ''
    for i in range(len(string)):
        if string[i] != ' ':
            p = (ord(string[i]) - ord(key_[i]) + 26) % 26
            p += ord('A')
            res += chr(p)
        else:
            res += ' '
    return res


#Dont run this. DONT.
def key(string, key):
    s = ""; i = 0 
    while(len(s) != len(string)):
        s += key[i%len(key)]
        i+=1
    return s

#Just run this for cipher.
def encrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string,key1)
    cipher = ""
    for i in range(len(key_)):
        if(string[i] != ' '):
            p = (ord(string[i]) + ord(key_[i]))%26
            p += ord('A')
            cipher += chr(p)
        else:
            cipher += ' '
    return cipher
#Run to decipher. 
def decrypt(string, key1):
    string = string.upper()
    key1 = key1.upper()
    key_ = key(string, key1)
    res = ""
    for i in range(len(string)):
        if(string[i] != ' '):
            p = (ord(string[i]) - ord(key_[i]) + 26)%26
            p += ord('A')
            res += chr(p)
        else:
            res += ' '
    return res



