Skip to content

Grosse-pasteque/ChrEnD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chr - EnD [0.5.0]

By Big watermelon#6705


How it works ?

Python can transform letter to their index which is inside of the utf-8 table

ord('a')     -> 97
chr(97)      -> 'a'

Simplified explainations:

  1. text -> list
text = list(text)

"hello" -> ['h', 'e', 'l', 'l', 'o']
  1. each char -> ord(char)
ord('h') -> 104
  1. apply mathematical operations on the obtained number with modifiers
104 -> 108 (+4)
  1. return joined text
'.'.join(text)

["108", "105", "112", "112", "116"] -> "108.105.112.112.116"
  1. repeat 1, 2, 3 and 4 for number of required turns

Functions:

You have at your disposition these function:

  • seed
  • encrypt
  • decrypt
  • transform
  • untransform
  • combinations
import chrend

# all the allowed (operators, values): chrend.OPERATORS, chrend.CONV
seed = chrend.seed(turns=1, modifiers=[("+", "%l"), ("*", 2)])
print(seed)


encrypted = chrend.encrypt('hello ma boi :)', seed=seed)
print(repr(encrypted))

tencrypted = chrend.transform(encrypted)
print(repr(tencrypted))

encrypted = chrend.untransform(tencrypted)
print(repr(encrypted))

decrypted = chrend.decrypt(encrypted, seed=seed)
print(repr(decrypted))
Seeds

Seeds works like in minecraft:

But be careful, modifiers are math operations so one modifier can be equal to another. Example bellow

import chrend

seed_one = chrend.seed(turns=1, modifiers=[("<<", 4)])
# 0x1a4b5

seed_two = chrend.seed(turns=3, modifiers=[("*", 16)])
# 0x1a16b2

encrypted_one = chrend.encrypt('text', seed=seed_one)
encrypted_two = chrend.encrypt('text', seed=seed_two)

print(encrypted_one == encrypted_two)
# shows: True