Prob­lem

Each char­ac­ter on a com­puter is assigned a unique code and the pre­ferred stan­dard is ASCII (Amer­i­can Stan­dard Code for Infor­ma­tion Inter­change). For exam­ple, upper­case A = 65, aster­isk (*) = 42, and low­er­case k = 107.

A mod­ern encryp­tion method is to take a text file, con­vert the bytes to ASCII, then XOR each byte with a given value, taken from a secret key. The advan­tage with the XOR func­tion is that using the same encryp­tion key on the cipher text, restores the plain text; for exam­ple, 65 XOR 42 = 107, then 107 XOR 42 = 65.

For unbreak­able encryp­tion, the key is the same length as the plain text mes­sage, and the key is made up of ran­dom bytes. The user would keep the encrypted mes­sage and the encryp­tion key in dif­fer­ent loca­tions, and with­out both “halves”, it is impos­si­ble to decrypt the message.

Unfor­tu­nately, this method is imprac­ti­cal for most users, so the mod­i­fied method is to use a pass­word as a key. If the pass­word is shorter than the mes­sage, which is likely, the key is repeated cycli­cally through­out the mes­sage. The bal­ance for this method is using a suf­fi­ciently long pass­word key for secu­rity, but short enough to be memorable.

Your task has been made easy, as the encryp­tion key con­sists of three lower case char­ac­ters. Using cipher1.txt (right click and ‘Save Link/Target As…’), a file con­tain­ing the encrypted ASCII codes, and the knowl­edge that the plain text must con­tain com­mon Eng­lish words, decrypt the mes­sage and find the sum of the ASCII val­ues in the orig­i­nal text.

Solu­tion

Share

Leave a Reply