Project Euler/59: Difference between revisions
From charlesreid1
| Line 1: | Line 1: | ||
==Problem Statement== | ==Problem Statement== | ||
This question is about a method of encrypting ASCII text. | |||
Each character in ASCII has some representation (e.g., A=65, *=42, k=107) | |||
Encryption technique is to take text file, convert bytes to ASCII, and XOR each byte with a character from a secret key | |||
Password method: use a password in place of a secret one-time pad; shorter than message, so repeated cyclically throughout method. | |||
You are given a file with encrypted ascii codes, knowledge that plain text must contain common English words, and told encryption key consists of 3 lowercase characters. Decrypt message, find sum of ascii values in original text. | |||
Sample file looks like this: <code>36,22,80,0,0,4,23,...</code> | |||
Link: https://projecteuler.net/problem=59 | Link: https://projecteuler.net/problem=59 | ||
==Approach== | |||
==Flags== | ==Flags== | ||
{{ProjectEulerFlag}} | {{ProjectEulerFlag}} | ||
Revision as of 17:57, 14 April 2025
Problem Statement
This question is about a method of encrypting ASCII text.
Each character in ASCII has some representation (e.g., A=65, *=42, k=107)
Encryption technique is to take text file, convert bytes to ASCII, and XOR each byte with a character from a secret key
Password method: use a password in place of a secret one-time pad; shorter than message, so repeated cyclically throughout method.
You are given a file with encrypted ascii codes, knowledge that plain text must contain common English words, and told encryption key consists of 3 lowercase characters. Decrypt message, find sum of ascii values in original text.
Sample file looks like this: 36,22,80,0,0,4,23,...
Link: https://projecteuler.net/problem=59
Approach
Flags