Page 1 of 3

Dycrypter With Python

PostPosted: Sun Jul 19, 2009 9:12 pm
by Sooper1337
Dont Know if this is the right place or not but would anyone be kind enough to help me make a script to decrypt XECryption. if it is possible and someone would like to help a beginner (No experience with python or scripting at all) then i will be greatly appreciated.

Re: Dycrypter With Python

PostPosted: Sun Jul 19, 2009 10:14 pm
by TheMindRapist
Firstly, do you understand how the algorithm works?
Secondly, this probably belongs in the Realistic 6 forum.
Edit: Maybe I was wrong, since you aren't supposed to make new topic in there.
My apologies.

Re: Dycrypter With Python

PostPosted: Sun Jul 19, 2009 10:33 pm
by Sooper1337
i know the basics of the algorithm like how every 3 sets of numbers are 1 letter. the password provided helps determine the letter. and its is ASCII coding. and to decrypt the the encryption you add the three numbers in the set together and subtract the password key. basically trial and error. but i want to learn to script in python. and for it to help me in realistic mission 6. so why not try to kill 2 birds with one stone =).

Re: Dycrypter With Python

PostPosted: Mon Jul 20, 2009 5:43 am
by hellwitch
I posted a python script and an explanation of how i did it in the forum already...go to the last page of realistic 6 forum. If you want i can send you the complete script with comments. But basically once you understand the algorithm, writing the script is a breeze. The main code is 5 lines or so. If what you want is to learn Python you should probably go thru the tutorial on the official Python site. It's really good. Cheers.

Re: Dycrypter With Python

PostPosted: Mon Jul 04, 2011 5:10 am
by SpanningTree
Do you think you could repost that code if you still have it? I solved the mission, but the one I wrote in Python is a mess. I would like to see how you did it in like 5 lines

Re: Dycrypter With Python

PostPosted: Sat Jul 21, 2012 10:47 am
by installman
take this code,run it, and choose the right answer

Code removed

Re: Dycrypter With Python

PostPosted: Sat Jul 21, 2012 7:22 pm
by anarchy420x
Look at the post times.

Re: Dycrypter With Python

PostPosted: Sun Jul 22, 2012 10:36 am
by limdis
Installman - that was pretty cool seeing that in action +1.
However, posting the code up like that is practically the answer. If someone wants to analyze it further you will have to keep it to PMs.

Re: Dycrypter With Python

PostPosted: Sun Jul 22, 2012 7:47 pm
by installman
sorry for that,i promiss that will never happen again.
:lol:

Re: Dycrypter With Python

PostPosted: Tue Dec 25, 2012 1:02 am
by the_ordinary
Yey! finally i can decrypt the message..
now i want to share what i learn when i try to solve the message

first, most people know how the xecryption algorithm work, but the problem is "how can i get the password value?"
the password value take a very important role in this mission.. coz if you know the password value, you don't need to brute force the message :)

second, remember the magic word! :D
thanks to T3hR34p3r for writing the article (sry i doubt to post the link)
here's the magic word from that article that help me to recognize my mistake:
In English, the letter which most frequently occurs is e. Afterward, the succession runs thus: a o i d h n r s t u y c f g l m w b k p q x z.
-Edgar Allen Poe

but you need to think something.. beside character 'e' there is another character which most frequently occurs :)
let's say that another character is "Mr.X"

that quote help me to relize my mistake.. what is that?
after i recognize how xecryption works, i write my own program using python to sum the number in the encrypted message.. so i get a list like this:
[849, 861, 811, 879, 863, 870, 793, ... <-- dummy

and then i find the minimum number from that list using min() function to find (Mr.X) character ascii, after that i will manipulate that number with (Mr.X) ascii code to get the password value. for example 871 - 65 = 806 <- here's the password value. but what i get is so many unknow character :shock:
this is my biggest mistake coz i made an assumption "if i can get the minimum number, there is a posibility that number is (Mr.X) character" i forget there is possibily for "new line" character :oops:

but, after reading the quote from Allen Poe, i realize that i don't need to find the minimum number! i just need to find the most frequently occurs number! because in long text, the possibilty of (Mr.X) character become the most frequently occurs is very high.. so i write my own function to find the most frequently occurs number from the list. here's the result looks like:

845 : 4
846 : 3
851 : 1
859 : 21
860 : 2
861 : 10

now, i get the number and i know the meaning of this number. so, i get the password value and i can manipulate the encrypted value using the password value to get the "real value" and then convert them to character to get the message :D

if you want to make the script using python here's the function which i use:
1. open(filename) <- to read encrypted message from text file
2. rstrip() <- clean the encrypted message from new line char
3. split('.') <- split the number using '.' delimiter
4. list_of_number.count(number) <- to count the number occurence
5. chr(ascii_code) <- convert the ascii code to character
6. set() <- to remove duplicate number

ps: i hope this is not a spoiler, if u think this is a spoiler please remind me so i can delete this post. (or maybe moderator can delete it for me :))