Created
December 5, 2019 17:33
-
-
Save m3dsec/b8ad2cd34bfbe6ce528958355b2d1e50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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