Problem 059

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you
are requested to be thoughtful in not posting anything
that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Susanne
Posts: 32
Joined: Sun Nov 08, 2009 7:39 am

Re: Problem 059

Post by Susanne »

rayfil said:
This problem was published more than 7 years ago (2000+ days) and solved by more than 11,000 members over those years without a single comment about its content, until this week.
Many posts to the thread of Problem 59 (View Problem) contain a comment on the religious content of the problem. Therefore, when I posted my comment, I was not aware that my religious opinion might not be whished-for to be known. For the future, I will try to avoid any non-mathematical critique.
Image

User avatar
thedoctar
Posts: 74
Joined: Fri Apr 15, 2011 11:57 am
Location: Sydney, Australia

Re: Problem 059

Post by thedoctar »

Hey, wow I had so much fun solving this problem! In relation to identifying which key was correct, I used two factors to reduce the number of possible keys/text, but I shall not reveal the two factors so I don't reveal how to solve the problem.

However, one of my factors needed a certain word to appear in the text (one of the most common word used in English) and filtered all text produced from a key that didn't have that word but if the original text didn't contain the word, I would've been screwed.

Is there any algorithm that is fast and can tell you whether a piece of text is genuine or a load of gibberish?
4x Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz
Image
fabas indulcet fames

matts1
Posts: 5
Joined: Sat May 07, 2011 11:19 pm

Re: Problem 059

Post by matts1 »

I found the encryption key by looking at the frequency, but was wondering. Is it supposed to have any special characters in the plaintext?
Coding in Python (3rd year programming)
Image

User avatar
thedoctar
Posts: 74
Joined: Fri Apr 15, 2011 11:57 am
Location: Sydney, Australia

Re: Problem 059

Post by thedoctar »

I assumed that there weren't supposed to be special characters.
4x Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz
Image
fabas indulcet fames

thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 059

Post by thundre »

matts1 wrote:I found the encryption key by looking at the frequency, but was wondering. Is it supposed to have any special characters in the plaintext?
Letters, numbers, whitespace, punctuation -- all "printable characters". There are no form-feeds or anything like that. It should be pretty easy to output the plaintext if you figured out the key already.
Image

mdean
Posts: 165
Joined: Tue Aug 02, 2011 2:05 am

Re: Problem 059

Post by mdean »

This problem is giving me fits so far. And I'm not even on the decryption part yet. I'm just trying to read in all the values and print them back out but I can't seem to do it without it crashing or freezing. If it's not improper, is there anyone I can pm with the C++ code I haven't gotten to work?

Update: never mind. Got it working, solved the problem. Man I wish the other thread for this was open. I mean, what I did was similar to what others had done, but it eliminated any doubt I found the solution. :)
Image

Fogmeister
Posts: 27
Joined: Mon Aug 22, 2011 11:20 am

Re: Problem 059

Post by Fogmeister »

Well I'm completely stumped by this one.

I have checked the xor function works using *, k and A and it all works fine.

However, every line of output has unprintable chars in it.

I have tried filtering all sorts of different ways to no avail.

Hmm...

Maybe I need to try a few different XOR combinations.

::EDIT::

Just checked against the XORs from page 2 and it isn't working :(

The good thing is though that I just need to rewrite that and it should work fine :D

::EDIT 2::
OK, so I got the XOR working and I've run the code and found the password. However, it only returns the first 24 characters of the line in English. After character 24 in the line it just becomes random nonesense again :(

Nevermind, got it now :D
Image

JMW1994
Posts: 43
Joined: Sat Apr 09, 2011 11:35 pm

Re: Problem 059

Post by JMW1994 »

Are we supposed to decrypt like this: 79^59 then take the last number in the list and do this 59^12; 79^59, take the result, and do it again like this (79^59)^12; or 79^59 and then take the next pair and XOR it 12^2. It doesn't really explain as I never did this before. I know how the XOR works as this is a binary concept.
Image

User avatar
rayfil
Administrator
Posts: 1405
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 059

Post by rayfil »

Let's assume that the encryption key is "abc". You need to XOR the first character of the text with the first character of the key "a". Then XOR the second character with "b" and the third character with "c". The fourth character would be XORed with "a", the next one with "b", the next one with "c", the next one with "a", etc. etc.

You have to find what are the "abc" characters which will produce a readable decrypted text.
When you assume something, you risk being wrong half the time.

hampelratte
Posts: 5
Joined: Mon Jan 23, 2012 8:13 pm

Re: Problem 059

Post by hampelratte »

Hi everyone,

I think, I have solved this problem. I have decoded the text and can read it. The password I found, make sense in the context of the text, too. But it is not accepted. May I PM my solution to someone, so that I know, if it's correct or not?

BR
Henrik

User avatar
jaap
Posts: 550
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 059

Post by jaap »

hampelratte wrote:The password I found, make sense in the context of the text, too. But it is not accepted.
The question does not ask for the password but for the sum of the ascii values of the decoded text.

hampelratte
Posts: 5
Joined: Mon Jan 23, 2012 8:13 pm

Re: Problem 059

Post by hampelratte »

D'oh!

Thanks for telling me, to read the text more properly in the future ;)

hampelratte
Posts: 5
Joined: Mon Jan 23, 2012 8:13 pm

Re: Problem 059

Post by hampelratte »

So, now that I know, what I have to do, I summed up the ASCII codes of every single char of the decrypted text. It still does not accept my answer. Don't know, what I'm doing wrong. Do I have to leave out characters? For example "space"?

User avatar
rayfil
Administrator
Posts: 1405
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 059

Post by rayfil »

You must add up the ascii value of ALL the characters of the decrypted text.
When you assume something, you risk being wrong half the time.

hampelratte
Posts: 5
Joined: Mon Jan 23, 2012 8:13 pm

Re: Problem 059

Post by hampelratte »

OK, that's what I did. I also calculated the value with different methods and got always the same value. Now I'm really confused.

User avatar
jaap
Posts: 550
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 059

Post by jaap »

hampelratte wrote:OK, that's what I did. I also calculated the value with different methods and got always the same value. Now I'm really confused.
Make sure you are not including for example a newline character at the end in your sum. Count how many character you are summing and compare with how many integers are given in the input file.

hampelratte
Posts: 5
Joined: Mon Jan 23, 2012 8:13 pm

Re: Problem 059

Post by hampelratte »

Thanks alot. Due to the cyclic use of the password, I increased my decoding loop by 3 on each run. And that's why I missed the last character. My value has now been accepted.

Loers
Posts: 10
Joined: Sun Aug 19, 2012 3:03 am

Re: Problem 059

Post by Loers »

what does it meant that the "encryption key consists of three lower case characters" ?
like if the key was aaa , then what is the numeric value of "aaa" ?

TripleM
Posts: 382
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 059

Post by TripleM »

Did you see the first paragraph? The ASCII value of a is 97, so the key would be 97, 97, 97.

Loers
Posts: 10
Joined: Sun Aug 19, 2012 3:03 am

Re: Problem 059

Post by Loers »

yea but how do u i use that ??
like , if the key was "abc" which is 97,98,99
and the first few values in the file are 79,59,12,2,79,35
then I shouldcaculate
97 XOR 79
98 XOR 59
99 XOR 12
97 XOR 2
98 XOR 79
...
and so on ??

Post Reply