Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@axialmarketsteve
Created October 20, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axialmarketsteve/37d60b77dbb06e24a6ff to your computer and use it in GitHub Desktop.
Save axialmarketsteve/37d60b77dbb06e24a6ff to your computer and use it in GitHub Desktop.
Test file for decryption question
42,0,8,75,8,5,18,76,55,30,2,0,10,21,68,10,24,68,10,2,7,3,3,22,69,76,48,3,9,68,24,24,11,25,1,68,3,13,0,75,11,11,5,9,68,15,3,19,5,76,5,75,11,22,14,13,16,75,8,1,10,0,72,75,14,17,31,76,16,3,9,68,24,9,5,75,4,5,15,76,10,4,24,74,75,37,16,75,27,5,24,76,23,31,5,8,7,76,20,2,0,13,5,11,68,2,24,23,75,10,22,4,24,12,18,76,12,2,0,8,24,76,12,2,11,12,75,5,10,75,13,13,25,76,70,4,25,16,24,5,0,14,64,70,75,13,23,75,27,1,75,15,11,30,0,0,75,28,8,10,5,10,7,21,68,24,9,1,75,27,13,31,4,68,31,4,1,75,11,8,10,31,23,14,31,74,75,59,1,75,15,11,30,0,0,75,2,11,31,76,20,25,3,20,14,30,8,18,76,6,14,11,13,5,76,5,75,28,8,14,13,23,30,30,1,75,9,28,8,25,22,24,5,11,5,76,11,5,76,55,30,2,0,10,21,95,75,27,1,75,15,11,30,0,0,75,2,11,31,76,11,13,10,1,25,76,17,5,24,22,2,9,0,75,31,16,4,1,5,8,4,23,75,24,11,75,31,11,75,28,13,31,5,8,14,31,23,75,13,68,24,9,5,75,13,23,75,24,12,10,24,74,75,59,1,75,1,17,24,24,68,7,5,1,75,31,16,2,0,8,75,24,13,7,0,68,38,3,10,15,13,29,69,76,37,5,8,68,28,9,68,15,5,0,69,76,38,30,24,68,28,9,68,3,13,0,75,30,1,27,9,16,2,24,13,4,2,23,75,3,2,75,15,12,30,30,7,3,76,5,5,8,68,27,30,5,18,9,22,70,1,1,14,24,13,5,11,23,80,76,5,5,8,68,24,3,72,75,3,2,75,15,11,30,30,23,14,64,68,28,9,68,28,9,22,14,76,14,30,31,16,75,13,23,75,9,8,2,11,13,9,0,29,75,31,13,31,25,5,31,9,0,75,13,23,75,27,1,75,15,11,30,0,0,75,4,5,29,9,68,9,9,1,5,76,5,5,21,68,28,4,1,25,9,74,97,102,45,75,27,5,24,76,17,27,76,1,10,30,8,18,76,16,3,13,16,75,63,5,9,14,5,31,4,68,6,3,22,5,5,10,12,76,5,5,8,68,28,13,23,75,9,5,25,0,29,75,24,11,75,14,22,14,13,15,13,13,23,31,66,68,34,76,2,14,0,16,75,13,68,27,9,22,13,9,7,31,0,29,75,2,5,31,25,22,10,0,68,15,9,23,2,30,1,75,24,11,75,4,5,29,9,68,10,76,3,4,3,0,71,76,8,4,2,3,71,76,17,5,28,22,14,6,17,15,5,7,14,8,68,7,3,11,0,76,5,31,76,16,3,9,68,27,13,23,24,9,10,12,9,22,24,76,5,31,76,5,75,24,13,6,9,68,28,4,1,5,76,16,3,9,29,75,31,12,4,25,8,15,76,6,14,76,2,25,9,1,75,10,22,4,1,68,24,9,8,13,65,7,4,2,23,8,5,11,30,31,10,14,31,23,137,236,240,28,4,13,8,4,68,2,31,68,10,24,68,9,30,1,10,7,2,10,31,16,71,76,19,3,9,10,75,31,17,8,4,68,10,76,9,4,1,1,5,24,68,4,15,7,30,30,23,75,5,10,75,24,12,14,76,8,2,26,1,24,76,11,13,76,12,30,1,5,5,76,6,14,5,10,12,31,68,10,24,68,10,0,8,69,102,45,75,27,5,24,76,3,25,9,5,31,0,29,75,31,17,25,28,22,2,31,1,15,76,16,4,76,23,14,9,68,24,3,68,6,13,10,18,76,1,7,8,1,25,0,29,75,28,1,4,28,8,14,142,228,255,37,68,6,5,3,3,24,68,10,0,9,4,31,16,75,31,5,18,64,68,24,3,68,6,13,10,18,76,18,14,2,1,25,13,6,7,9,68,27,9,11,27,0,1,69,76,37,75,11,8,10,2,7,14,76,5,31,76,16,3,9,68,7,3,10,12,76,8,2,2,1,24,76,11,13,76,12,14,13,0,24,76,19,10,31,68,10,28,16,75,24,11,75,1,5,0,9,68,4,2,1,75,24,12,2,2,15,75,5,16,75,27,5,24,76,5,7,0,68,12,30,5,18,66,68,41,25,16,75,5,16,75,27,5,24,76,10,4,24,74,75,56,12,14,30,1,75,27,5,24,76,5,75,24,11,7,9,22,10,14,8,18,76,2,10,5,22,75,31,20,25,5,10,0,0,13,5,11,68,4,10,68,18,3,17,5,11,68,13,3,8,0,31,72,75,13,10,15,76,5,5,3,16,3,9,22,75,10,5,2,30,68,24,28,22,2,2,15,7,5,10,12,76,11,13,76,3,14,2,16,7,9,9,14,2,68,10,2,0,75,0,5,15,5,1,24,76,19,3,3,68,28,9,22,14,76,10,4,2,73,8,3,9,6,5,16,31,13,8,75,13,23,75,24,11,75,13,3,14,64,68,9,9,13,5,11,68,5,9,13,31,4,1,25,76,5,8,24,17,10,0,8,18,76,11,7,8,68,4,30,68,10,14,23,4,0,17,31,9,8,18,76,29,4,25,10,12,66,110,97,56,12,14,76,10,14,20,16,75,1,11,25,2,13,5,11,68,28,9,68,28,9,13,12,4,1,15,76,5,5,15,12,4,30,68,10,2,0,75,27,1,5,24,68,31,3,68,24,9,5,69,76,45,31,76,19,10,31,68,10,76,3,25,9,5,31,76,12,10,28,20,2,2,1,24,31,68,31,3,68,12,9,16,75,13,19,10,21,68,10,10,16,14,30,68,31,4,13,24,76,0,25,13,3,12,5,10,12,64,68,15,5,23,27,5,22,2,24,13,5,11,68,15,9,8,10,21,74,75,37,68,31,4,11,30,11,12,31,76,16,3,9,22,14,76,10,14,26,1,25,76,19,10,31,68,24,25,7,3,76,3,7,13,0,5,9,23,24,76,13,5,76,16,3,9,68,10,5,22,75,14,1,13,3,22,14,64,68,24,25,7,3,76,6,25,5,3,3,24,10,14,31,23,75,5,10,75,24,12,14,76,23,30,2,72,75,31,17,8,4,68,9,9,5,30,24,29,75,5,10,75,24,12,14,76,23,14,13,74,75,37,68,28,13,23,75,31,5,31,5,23,13,5,1,15,76,19,2,24,12,75,24,12,14,76,20,2,15,10,2,15,68,31,4,1,5,76,5,5,8,68,28,5,16,3,76,5,7,0,68,2,24,23,75,14,1,7,3,10,12,5,10,12,31,74,75,45,8,7,76,9,18,76,9,10,0,13,8,5,11,30,31,68,2,2,23,31,5,10,8,24,23,75,27,1,25,9,68,15,9,5,15,76,19,2,24,12,2,2,68,6,9,95,75,13,10,15,76,5,24,76,37,6,9,22,2,15,5,75,10,5,15,9,0,75,3,17,31,76,11,13,76,23,2,11,12,31,64,68,34,76,16,3,5,10,0,76,5,75,31,20,2,30,13,31,76,11,13,76,7,3,13,22,2,24,29,75,30,11,24,9,68,30,28,68,2,2,68,31,4,1,2,30,68,27,0,5,8,9,68,31,4,5,31,76,19,10,31,68,10,31,68,9,3,17,5,8,8,14,31,23,71,76,2,4,30,68,31,4,1,75,24,13,6,9,68,9,9,13,5,11,72,75,13,23,75,24,12,14,76,6,25,3,5,15,76,11,8,9,5,5,76,16,3,13,16,75,27,5,24,76,12,14,13,18,2,2,3,75,5,16,24,76,6,2,0,8,4,27,23,75,13,6,4,25,16,75,25,23,69,76,45,75,27,13,24,4,1,15,76,16,4,76,1,19,28,22,14,31,23,75,1,29,75,10,1,14,0,13,5,11,23,137,236,240,34,76,19,2,31,12,14,8,68,31,3,68,7,5,2,31,76,17,27,76,9,18,76,18,4,5,7,14,76,5,5,8,68,24,5,10,12,87,68,9,25,16,75,37,68,15,5,0,75,2,11,31,76,15,5,3,19,75,13,10,18,24,12,2,2,3,75,24,11,75,31,13,5,11,72,75,13,10,15,76,23,4,76,45,75,27,5,24,76,11,9,0,13,12,9,0,75,24,11,75,11,13,29,9,68,30,28,68,31,4,1,75,5,0,14,13,74,75,37,16,75,27,5,24,76,10,4,76,8,4,31,23,75,24,11,75,24,12,14,76,23,3,5,20,71,76,16,3,3,17,12,4,72,75,28,1,25,4,5,27,31,74,97,102,45,31,76,19,10,31,68,9,30,1,14,22,29,75,13,10,15,76,20,7,9,5,24,13,10,31,64,68,9,25,16,75,24,12,14,76,23,14,13,68,28,13,23,75,31,16,2,0,8,75,26,1,25,21,68,25,3,17,12,4,74,75,35,10,14,76,7,4,25,8,15,76,10,4,24,68,27,30,11,6,9,10,10,8,1,75,27,13,31,4,11,30,24,68,25,5,23,0,5,10,12,76,12,2,31,68,5,9,7,0,87,68,10,24,68,4,2,1,75,1,11,6,9,10,31,76,16,3,9,68,9,3,19,24,28,22,2,24,68,28,13,23,75,24,5,0,5,10,12,76,5,75,8,1,10,8,8,18,76,5,2,1,68,10,24,68,31,4,1,75,31,17,5,76,13,5,76,9,2,8,12,14,13,18,14,2,72,75,13,10,15,76,5,31,76,16,3,9,68,5,9,28,31,76,13,31,76,19,10,31,68,31,30,29,2,2,3,75,24,11,75,4,5,25,28,11,4,2,68,10,76,23,3,13,22,0,76,13,5,76,16,3,9,68,9,3,16,31,3,9,75,3,2,75,24,12,14,76,11,8,9,5,5,66,68,60,4,5,31,76,5,75,27,1,2,30,0,75,31,1,5,31,5,31,5,11,5,76,13,31,76,13,24,76,16,4,76,2,14,9,8,75,24,12,14,76,23,31,9,22,5,76,11,13,76,5,75,31,12,2,28,68,24,5,10,0,5,10,12,76,23,28,5,2,31,0,29,75,10,22,4,1,68,30,2,0,14,30,68,18,3,17,75,13,10,15,76,23,14,9,68,31,4,1,75,14,11,28,76,7,7,5,9,9,5,10,12,76,12,2,11,12,75,13,19,10,21,68,10,1,11,5,11,68,31,4,1,75,15,8,4,25,0,24,77,68,36,2,1,76,31,68,24,13,2,14,31,16,75,15,11,30,30,23,14,76,16,3,13,16,75,8,5,18,76,19,10,31,68,31,3,68,8,0,5,24,28,68,10,76,22,10,5,8,2,2,3,75,13,10,15,76,12,10,2,3,75,3,10,80,76,19,10,0,15,2,2,3,75,27,5,24,76,16,4,3,68,27,30,1,8,13,22,2,3,17,24,76,5,75,28,5,24,24,13,6,9,74,97,102,38,18,76,23,4,1,1,75,4,5,27,28,29,75,10,11,25,24,17,5,9,68,34,76,19,10,31,68,5,3,16,75,31,1,10,31,13,8,7,74,137,236,240,63,4,5,31,76,19,10,31,68,10,76,16,3,5,10,12,76,16,4,76,6,14,76,20,25,3,17,15,76,11,13,66,68,34,76,12,10,8,68,5,3,16,75,13,8,28,13,29,24,76,1,24,15,5,27,9,0,75,14,1,13,3,22,14,66,68,34,10,68,31,4,1,25,9,68,2,31,68,4,2,1,75,24,12,2,2,3,75,5,10,75,24,12,14,76,19,4,30,8,15,76,16,3,13,16,75,27,13,7,0,68,6,13,15,14,76,5,75,1,5,5,76,20,14,15,17,7,5,5,25,0,29,75,13,10,15,76,13,5,31,17,13,10,1,25,13,6,7,21,68,24,9,8,13,65,7,4,2,7,14,5,16,14,8,72,75,5,16,75,5,23,75,24,11,75,4,5,29,9,68,3,5,23,75,31,16,4,1,5,8,4,68,9,9,12,10,26,1,75,5,16,24,9,8,13,64,68,31,4,1,75,10,13,25,31,16,75,8,5,18,76,5,31,76,23,14,13,72,75,27,12,14,2,68,5,9,5,25,0,29,75,13,8,7,76,12,2,31,68,8,3,9,25,13,0,14,31,68,10,30,1,75,31,1,10,31,13,8,7,74,75,63,11,4,2,68,10,76,18,14,2,1,25,13,6,7,9,68,13,3,23,24,5,8,71,76,23,3,13,19,7,9,0,75,24,11,75,24,12,14,76,7,3,5,10,75,13,10,15,76,6,10,2,0,10,11,1,15,76,8,2,7,1,75,13,68,6,25,9,6,21,72,75,13,20,27,9,5,25,9,0,75,13,16,75,24,12,14,76,0,4,3,22,75,3,2,75,24,12,14,76,5,13,24,1,25,76,0,14,15,15,70,4,11,30,31,1,71,76,5,5,8,68,31,4,1,75,2,1,19,24,68,7,25,22,8,4,68,4,10,68,31,4,1,75,31,12,2,28,68,24,4,11,31,76,12,2,1,68,2,2,16,4,76,9,18,76,5,25,1,23,69,76,110,97,76,73,75,33,5,25,7,68,63,27,5,2,2,68,67,37,10,5,3,7,14,2,16,24,76,37,9,30,11,10,8,77,97
@axialmarketsteve
Copy link
Author

The given text file contains encrpyted bytes. Your goal is to decrypt the message. In order to do so you need to identify a secret key (3 lowercase letters) which is used to encrypt the message as follows:

- XOR the 1st byte of the text with the 1st byte of the key
- XOR the 2nd byte of the text with the 2nd byte of the key
- XOR the 3rd byte of the text with the 3rd byte of the key
- XOR the 4th byte of the text with the 1st byte of the key
- XOR the 5th byte of the text with the 2nd byte of the key
- ...

The same mechanism is used to decrypt the key, which is possible given the nature of XOR (65 XOR 42 = 107, and 107 XOR 42 = 65).

In order to idenfiy the key you must work with the assumption that the text contains english and that we can measure how "english like" a body of text is simply by counting the number of spaces. So they key you are looking for is that one that yields the most number of spaces in the encryped text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment