@heyitsmarcus/

Encryption

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8889933068080063","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"I25vdCBteSBjb2RlLCBoZWxwIGZpbGUgZm9yIFJlcGwgVGFsay0+QXNrCgpwcmludCgnV2VsY29tZSB0byB0aGUgZW5jcnlwdG9yLicpCm1lbnUgPSBpbnB1dCgnV291bGQgeW91IGxpa2UgdG8gZW5jb2RlIG9yIGRlY29kZSBhIG5vdGU/ICcpCmxldHRlcnMgPSBbCiAgICAiYSIsICJiIiwgImMiLCAiZCIsICJlIiwgImYiLCAiZyIsICJoIiwgImkiLCAiaiIsICJrIiwgImwiLCAibSIsICJuIiwgIm8iLAogICAgInAiLCAicSIsICJyIiwgInMiLCAidCIsICJ1IiwgInYiLCAidyIsICJ4IiwgInkiLCAieiIsICcgJ10KY3lwaGVydGV4dCA9IFsKICAnSycsJ0QnLCdHJywnRicsJ04nLCdTJywnTCcsJ1YnLCdCJywnVycsJ0EnLCdIJywnRScsJ1gnLCdKJywnTScsJ1EnLCdDJywnUCcsJ1onLCdSJywnVCcsJ1knLCdJJywnVScsJ08nLCAnIScsIAogIF0KZGVmIGVuY29kZShub3RlKToKICBuZXdfbm90ZSA9IFtdCiAgZW5jb2RlZF9ub3RlID0gW10KICBsYXN0X25vdGUgPSAnJwogIGNvdW50ID0gMAogIHdoaWxlIGNvdW50ICE9IGxlbihub3RlKToKICAgIG5ld19ub3RlLmFwcGVuZChub3RlW2NvdW50XS5sb3dlcigpKQogICAgY291bnQgKz0gMQogIHByaW50KCdFbmNvZGluZyBub3RlLi4uJykKICBmb3IgaSBpbiBuZXdfbm90ZToKICAgIGZvciBsZXR0ZXIgaW4gbGV0dGVyczoKICAgICAgaWYgaSA9PSBsZXR0ZXI6CiAgICAgICAgZW5jb2RlZF9ub3RlLmFwcGVuZChjeXBoZXJ0ZXh0W2xldHRlcnMuaW5kZXgobGV0dGVyKV0pCiAgZm9yIGkgaW4gZW5jb2RlZF9ub3RlOgogICAgbGFzdF9ub3RlICs9IGkKICBwcmludChsYXN0X25vdGUpCgpwcmludChlbmNvZGUoJ1RoaXMgaXMgYSBwcmFjdGljZSBub3RlJykp"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#not my code, help file for Repl Talk->Ask

print('Welcome to the encryptor.')
menu = input('Would you like to encode or decode a note? ')
letters = [
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", ' ']
cyphertext = [
  'K','D','G','F','N','S','L','V','B','W','A','H','E','X','J','M','Q','C','P','Z','R','T','Y','I','U','O', '!', 
  ]
def encode(note):
  new_note = []
  encoded_note = []
  last_note = ''
  count = 0
  while count != len(note):
    new_note.append(note[count].lower())
    count += 1
  print('Encoding note...')
  for i in new_note:
    for letter in letters:
      if i == letter:
        encoded_note.append(cyphertext[letters.index(letter)])
  for i in encoded_note:
    last_note += i
  print(last_note)

print(encode('This is a practice note'))