Skip to content

Instantly share code, notes, and snippets.

@m3dsec
Created December 5, 2019 17:33
Show Gist options
  • Select an option

  • Save m3dsec/b8ad2cd34bfbe6ce528958355b2d1e50 to your computer and use it in GitHub Desktop.

Select an option

Save m3dsec/b8ad2cd34bfbe6ce528958355b2d1e50 to your computer and use it in GitHub Desktop.
#!/usr/share/python3
import pprint
'''
>>> ord('Ú')
218
>>> ord('n')
110
>>> 218-110
108
>>> chr(108)
'l'
'''
def morocanStyle(text, key):
global overAllResult
overAllResult = ''
keyLenght = len(key)
KeyPosition = 0
for every_Char in text:
key_Char = key[KeyPosition]
key_Char_ord = ord(key_Char)
new_Char_ord = ord(every_Char)
char_Division = key_Char_ord - new_Char_ord
result = chr(char_Division)
overAllResult += result
if len(overAllResult) == 13:
break
KeyPosition += 1
print('The Password is : ' + overAllResult)
morocanStyle("Encrypting this file with your key should result in out.txt, make sure your key is correct!", "¦ÚÈêÚÞØÛÝ݉×ÐÊ߅ÞÊÚɒæßÝˈÚÛÚêÙÉëéÑÒÝÍЅêÆáÙÞã–ÒшÐáÙ¦ÕæØžãÊÎ́ßÚêÆŽÝáäè‰ÎÍڌÎëÑÓäáÛÌ׉v")
# you may read directly from files with open() 'r'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment