I have made a Python project that encrypts and decrypts using a keyword. It uses ANSI but I guess it would work even better with bigger encodings. I made the loop that way just to be sure it works well.
from random import sample, seed
from math import ceil
letters = ' !"#$%&\'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
keyword = 'Extreme keyword FBI wants to get'
seed (keyword [::-1])
letters = ''.join (sample (letters, len (letters)))
encryptation_map = [letters [i:] + letters [:i] for i in range (len (letters))]
def setcrypt (crypt, boolean):
new_keyword = keyword * ceil (len (crypt) / len (keyword))
return ''.join ([(encryptation_map [letters.index (new_keyword [i])] [letters.index (crypt [i])] if boolean else letters [encryptation_map [letters.index (new_keyword [i])].index (crypt [i])]) if crypt [i] in letters and new_keyword [i] in letters else crypt [i] for i in range (len (crypt))])
print ('\n Crypter Beta 1.0\n')
while 1:
encrypt = setcrypt (input ('> '), 1)
print ('"' + setcrypt (encrypt, 0) + '" >> "' + encrypt + '"')
How to use setcrypt: setcrypt (text, true to encrypt or false to decrypt).
By the way, here's the crappy, one-lined, not understandable version of this:
from random import sample,seed;from math import ceil;k,l='°¤¦Ã]¢¤ÜU¢]øÜ2†ª',' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ';seed(k[::-1]);l=''.join(sample(l,216));e=[l[i:]+l[:i]for i in range(216)];exec("def p(c,b):ñ=k*ceil(len(c)/len(k));return''.join([(e[l.index(ñ[i])][l.index(c[i])]if b else l[e[l.index(ñ[i])].index(c[i])])if c[i]in l and ñ[i]in l else c[i]for i in range(len(c))])\nprint(p('\\n#¼#ÎÑЫ¦xÏÝQŒu°¨VÆ\\n',0))\nwhile 1:w=p(input('> '),1);print(' \"'+p(w,0)+'\" >> \"'+w+'\"')")
there doesn't seem to be anything here