<jupyter_start><jupyter_text>Vignerre Cipher<jupyter_code>alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
stringtoencrypt= input("Please enter message ")
stringtoencrypt=stringtoencrypt.upper()
keyword= input("Please enter number ")
keyword=keyword.upper()

int(len(keyword))
0%int(len(keyword))
encryptedstring=''
keywordstring=''
count=0
for currentcharacter in stringtoencrypt:
        print('---- ENCRYPTING Letter', count)
        position = alphabet.find(currentcharacter)
        shiftamount = alphabet.find(keyword[count%int(len(keyword))])
        newposition = position + shiftamount
        keywordstring = keywordstring + keyword[count%int(len(keyword))]
        encryptedstring = encryptedstring + alphabet[newposition]
        print('Original:', stringtoencrypt[0:count+1])
        print('Keyword: ',keywordstring)
        print('Enrypted:',encryptedstring)
        count=count+1

encryptedstring
decryptedstring=""
keywordstring=''
count=0
for currentcharacter in encryptedstring:
        print('---- DECRYPTING Letter', count)
        
        position = alphabet.find(currentcharacter)
        
        shiftamount = alphabet.find(keyword[count%int(len(keyword))])
        newposition = position - shiftamount
        keywordstring = keywordstring + keyword[count%int(len(keyword))]
        
        decryptedstring = decryptedstring + alphabet[newposition]
        print('Original:', encryptedstring[0:count+1])
        print('Keyword: ',keywordstring)
        print('Enrypted:',decryptedstring)
        count=count+1
        
        
decryptedstring<jupyter_output>---- DECRYPTING Letter 0
Original: C
Keyword:  T
Enrypted: J
---- DECRYPTING Letter 1
Original: CS
Keyword:  TO
Enrypted: JE
---- DECRYPTING Letter 2
Original: CSA
Keyword:  TOM
Enrypted: JEO
---- DECRYPTING Letter 3
Original: CSAI
Keyword:  TOMT
Enrypted: JEOP
---- DECRYPTING Letter 4
Original: CSAIO
Keyword:  TOMTO
Enrypted: JEOPA
---- DECRYPTING Letter 5
Original: CSAIOD
Keyword:  TOMTOM
Enrypted: JEOPAR
---- DECRYPTING Letter 6
Original: CSAIODW
Keyword:  TOMTOMT
Enrypted: JEOPARD
---- DECRYPTING Letter 7
Original: CSAIODWM
Keyword:  TOMTOMTO
Enrypted: JEOPARDY
{'fraction_non_alphanumeric': 0.10865561694290976, 'fraction_numerical': 0.007826887661141806, 'mean_word_length': 3.995402298850575, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '665003', 'license': 'MIT', 'n_tokens_mistral': 708, 'n_tokens_neox': 675, 'n_words': 148, 'path': 'Chapter 5- Encryption/Vignerre Cipher.ipynb', 'repo_name': 'john-s-butler-dit/Intro-to-Algorithms', 'size': '2172'}