Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-*- coding: utf-8 -*-
- # still under development for turkish...
- char_dict = {
- "a":1,
- "b":2,
- "c":3,
- "d":4,
- "e":5,
- "f":6,
- "g":7,
- "h":8,
- "i":9,
- "j":10,
- "k":11,
- "l":12,
- "m":13,
- "n":14,
- "o":15,
- "p":16,
- "q":17,
- "r":18,
- "s":19,
- "t":20,
- "u":21,
- "v":22,
- "w":23,
- "x":24,
- "y":25,
- "z":26,
- "A":27,
- "B":28,
- "C":29,
- "D":30,
- "E":31,
- "F":32,
- "G":33,
- "H":34,
- "I":35,
- "J":36,
- "K":37,
- "L":38,
- "M":39,
- "N":40,
- "O":41,
- "P":42,
- "Q":43,
- "R":44,
- "S":45,
- "T":46,
- "U":47,
- "V":48,
- "W":49,
- "X":50,
- "Y":51,
- "Z":52,
- "`":53,
- "~":54,
- "!":55,
- "@":56,
- "#":57,
- "$":58,
- "%":59,
- "^":60,
- "&":61,
- "*":62,
- "(":63,
- ")":64,
- "-":65,
- "_":66,
- "=":67,
- "+":68,
- "[":69,
- "]":70,
- "{":71,
- "}":72,
- "\\":73,
- "|":74,
- ";":75,
- ":":76,
- "'":77,
- "\"":78,
- ",":79,
- ".":80,
- "<":81,
- ">":82,
- "/":83,
- "?":84,
- "0":85,
- "1":86,
- "2":87,
- "3":88,
- "4":89,
- "5":90,
- "6":91,
- "7":92,
- "8":93,
- "9":94,
- " ":95,
- "\n":96,
- "\r":97,
- "\t":98,
- "\xe7":99,
- "\xf6":100,
- "\xfe":101,
- "\xfd":102,
- "\xf0":103,
- "\xfc":104,
- "\xc7":105,
- "\xd6":106,
- "\xde":107,
- "\xdd":108,
- "\xd0":109,
- "\xdc":110,
- }
- def encrypt(string):
- encrypted_list = []
- char_list = list(string)
- for char in char_list:
- char = char_dict[char]
- algorithm = (9*char)+char+(9*char)+(6*char)+16
- encrypted = r"\x%d" % algorithm
- encrypted_list.append(encrypted)
- output = ''.join(encrypted_list)
- return output
- def decrypt(signature):
- decrypted_list = signature.split(r'\x')
- del decrypted_list[0]
- output_list = []
- for char in decrypted_list:
- first_stage = int(char) - 16
- last_stage = first_stage / 25
- for key, value in char_dict.iteritems():
- if value == last_stage:
- output_list.append(key)
- output = ''.join(output_list)
- return output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement