📜 ⬆️ ⬇️

Simple text encryption - tuple of numbers, with complexity adjustment


Github


https://github.com/denisxab/SHISH

I wanted to make a very simple cryptographic application for text, suddenly there will be such a need.

The point is that encryption occurs with random numbers from the given bit , the second rand value sets the number of keys for each character so that it does not repeat and it is impossible to find the pattern of the text.
')
The key itself is stored in .json so it’s easy to send, view, edit it.

How it works ?


  1. Create a key.
  2. Share key.
  3. Write text in the "Encode" window, click on the button.
  4. Send text from the Decode window.

Because of the peculiarity of tkinter, it does not respond to the list but to the usual str, and therefore every indent in the Decode window is important.

Key creation


bit = input() rand = input() l = {} a = list('','','','','') for x in a: l[x]=[] for y in range(rand): l[x].append(random.getrandbits(bit)) print(l) 

Encode text


 slo = input() red =dict(   ) v = [] for x in slo: if x in red: v.append(random.choice(red[x])) print(v) 

Decode


 list_code = input() red = dict(   ) v = {} for x in red.items(): for z in list_code: if z in x[1]: v[z]=x[0] zx = [] for x in list_code: if x in v: zx.append(v[x]) 

Source: https://habr.com/ru/post/460727/


All Articles