# Older blog entries for darkewolf (starting at number 28)

This website was discovered this morning and provided me with a distraction to keep me occupied during lunch times and other times when my brain needs a kickstart.

It contains a number of enciphered texts and basically no clue on how to solve them. Well except for the more complex ones (which I am yet to try). But below I shall discuss how I solved Challenge 1 and Challenge 2.

Challenge 1

The cipher text is as follows:

```Zl sngure'f snzvyl anzr orvat Cveevc, naq zl Puevfgvna anzr Cuvyvc,
zl vasnag gbathr pbhyq znxr bs obgu anzrf abguvat ybatre be zber
rkcyvpvg guna Cvc.  Fb, V pnyyrq zlfrys Cvc, naq pnzr gb or pnyyrq
Cvc.
```

Looks pretty evil eh? Thankfully this one is dead easy. Its a common form of cipherment used on Usenet and other places, called Rot-13. Its a form of substitution cipher, done by rotating the characters 13 places modulo 26.

For instances, the letter A becomes the letter N (N is 13 characters ahead of A), of course, you need to wrap around if you use the letters N through to Z. This cipher is particularily convient when one has an even number of characters in their alphabet).

Thus the decipherment (using the following set of Unix commands cat challenge1.txt | tr '[A-M][N-Z][a-m][n-z]' '[N-Z][A-M][n-z][a-m]' > answer1.txt) :

```My father's family name being Pirrip, and my Christian name Philip,
my infant tongue could make of both names nothing longer or more
explicit than Pip.  So, I called myself Pip, and came to be called
Pip.
```

Pretty cool eh? :) As I said, its often (at least in the past) is used on Usenet to protect the punchlines from jokes from being accidently read.

Challenge 2

This one was moderately more tricky, but once I got the solution it was obvious.

```THESNFZOGH OA ZIT FSGETAA GY EGHCTSZOHU Q FKQOHZTBZ JTAAQUT OHZG QH QKZTSHQZT EOFITSZTBZ JTAAQUT.
ZIT EOFITSZTBZ JTAAQUT EGHZQOHA QKK ZIT OHYGSJQZOGH GY ZIT FKQOHZTBZ JTAAQUT, WXZ OA HGZ OH Q
YGSJQZ STQRQWKT WN Q IXJQH GS EGJFXZTS VOZIGXZ ZIT FSGFTS JTEIQHOAJ ZG RTESNFZ OZ. --- YSGJ
VOLOFTROQ, ZIT YSTT THENEKGFTROQ.
```

A quick try of Rot-13 showed it obviously wasn't the same cipher. This time I decided to be a bit trickier and wrote a quick perl program to do a frequency count of the characters present (Mostly to ensure I was dealing with a simple substitution cipher rather than something more complex). The program showed that the characters appeared to be distributed within the same frequencies as the English language (See the table below to see the character distribution of the English language):

```Character    Frequency
sp    0.186550
e    0.108321
t    0.079711
a    0.066101
h    0.062808
o    0.053881
s    0.049366
n    0.048965
r    0.047798
i    0.041987
l    0.036380
d    0.035168
u    0.024981
w    0.023349
m    0.020149
c    0.019151
g    0.017733
y    0.017043
f    0.014561
b    0.013218
p    0.012472
k    0.008703
v    0.008059
j    0.001296
x    0.001119
q    0.000615
z    0.000503
```

I did ignore the sp group though. Maybe I should add to my frequency count program to also test for pairs of letters also.

I got the following frequencies based on the file (only the first 5 though, rest on request):

``` 1)cipher (T)   count( 36)   freq (0.1385)
2)cipher (Z)   count( 30)   freq (0.1154)
3)cipher (Q)   count( 22)   freq (0.0846)
4)cipher (O)   count( 20)   freq (0.0769)
5)cipher (G)   count( 18)   freq (0.0692)
```

Now, what did this lead me to believe? I am fairly certain that T in the ciphertext would be the letter </b>e</b> in the real world. And I also made the assumption that Z would be t. Lets make that substition (using lowercase to indicate deciphered letters of course):

```eHESNFtOGH OA tIe FSGEeAA GY EGHCeStOHU Q FKQOHteBt JeAAQUe OHtG QH QKteSHQte EOFIeSteBt JeAAQUe.
tIe EOFIeSteBt JeAAQUe EGHtQOHA QKK tIe OHYGSJQtOGH GY tIe FKQOHteBt JeAAQUe, WXt OA HGt OH Q
YGSJQt SeQRQWKe WN Q IXJQH GS EGJFXteS VOtIGXt tIe FSGFeS JeEIQHOAJ tG ReESNFt Ot. --- YSGJ
VOLOFeROQ, tIe YSee eHENEKGFeROQ.
```

Looking good so far. At this stage I made some more substitions based on frequency and with one or two hiccups I ended up with a fairly good portion of it done. I also guessed I would be h due to the tIe word most likely being the.

From the point of having about 30% of it decoded, I used other Unix tools to find out potential words. Using the YSee on the last line I looked for words in the dictionary (well word list) that had four characters, two unknown ending in double e:

grep "^..ee\$" /usr/share/dict/words

```Agee
alee
Cree
flee
free
glee
knee
tree
```

Could be any of these. It would not be 'tree' as we had used the t before. And I decided to eliminate Agee, Alee, Cree cause they were silly.

And then it continued as I spotted more and more words.

Ultimately the message deciphered to be:

```encryption is the process of converting a plaintext message into an alternate ciphertext message.
the ciphertext message contains all the information of the plaintext message, but is not in a
format readable by a human or computer without the proper mechanism to decrypt it. --- from
wikipedia, the free encyclopedia.
```

I had deciphered it without really knowing the method it used. I used the following command to do it cat Chal2.txt | tr 'TZIYSGOJXHQRWKNEFVALBUC' 'ethfroimunadblycpwskxgv' > Decoded.chal2

So out of curiousity I went and wrote another perl script which showed the plaintext and the ciphertext versions side by side with their 'position' in the alphabet so I could see if there was any formula being used, and piped it through a sort so it would be in plaintext-alphabetical order:

First the perl display code I used:

```#!/usr/bin/perl
\$code  = "TZIYSGOJXHQRWKNEFVALBUC";
my (@a_plain) = split(//, \$plain);
my (@a_code)  = split(//, \$code);
\$length = length(\$plain);
for(\$i = 0; \$i < \$length; \$i++) {
printf "%s (%3d) -- %s (%3d)\n", \$a_plain[\$i], ord(\$a_plain[\$i]) - 96 , \$a_code[\$i], ord(lc(\$a_code[\$i])) - 96 ;
}
```

I ran the following ./Cipher.chal2.pl | sort and got the following:

```a (  1) -- Q ( 17)
b (  2) -- W ( 23)
c (  3) -- E (  5)
d (  4) -- R ( 18)
e (  5) -- T ( 20)
f (  6) -- Y ( 25)
g (  7) -- U ( 21)
h (  8) -- I (  9)
i (  9) -- O ( 15)
k ( 11) -- L ( 12)
l ( 12) -- K ( 11)
m ( 13) -- J ( 10)
n ( 14) -- H (  8)
o ( 15) -- G (  7)
p ( 16) -- F (  6)
r ( 18) -- S ( 19)
s ( 19) -- A (  1)
t ( 20) -- Z ( 26)
u ( 21) -- X ( 24)
v ( 22) -- C (  3)
w ( 23) -- V ( 22)
x ( 24) -- B (  2)
y ( 25) -- N ( 14)
```

How bloody obvious. The cipher substitution was using the QWERTY keyboard layout.

Now, the rest of the challenges may be a bit harder. Ideally I'd have a nice PDA with Perl installed and go sit down on the river and hack away on ciphers at my lunch, but for now that will have to wait *smirks*

I think I proved the benefit of objective peer review of code today, in a round about away.

Here at work we shifted to a new mail system using maildir and it was causing some people some problems. One of the problems was converting old mbox files to maildir. We were given a set of instructions how to do it which were easy to follow.

The engineering manager was being cautious and wanted to test the conversion on a single mbox file. He did so and it wouldn't work.

I scooted over and instantly pointed out where he was going wrong. He had used a line out of a for look and missed some of the conversion:

He typed the following:

mbconv.pl ~/Maildir/\$i < mboxfile.mbx

The obvious problem was the \$i.

The advantage of objective peer review of code is that the original programmer sees the code for what it is meant to do. The reviewer sees the code as purely code on a syntax level.

I may not know (in a specific sense) what the code the junior programmer next to me is writing is trying to do, but I can look over his shoulder and go "Aha, that line has XYZ error, cause it it will not be accessing the index properly" or something like that.

Oh, the fun of being a programmer again for fun and profit.

Hmmmmms.

Need a new toy. Assides from more audio / noise gear and maybe a new desktop soon, I want to get a decent PDA. Don't want to spend a fortune, but I want something I can write small apps for to do cute and useful stuff.

Something programmable with wireless preferably. A Zaurus would be nice if they still exist but I don't know how programmable they are.

I wonder.

A rather interesting article as linked off of SlashDot about Great Hackers.

I think all management should be made to read it, especially management in technical fields that have been technical themselves in the past.

That said, I am learning far too much about Radius than I really ever wanted to learn. Just finished and starting to test a 'radius client simulation' (ie: its pretending to be a NAS so we can test a testing-system POP by hammering it with real world radius data [with a bit of munging {I wonder if the word mung is used any more. Was used a lot when I was a a teenager}] in order to find out if we can break it before it rolls out live).

Assides from having to use a MS Windows workstation (with a dozen ssh shells open to development servers) I am very much loving this job. Great folk, great environment, free fruit.

Of course, ideally I'd love to get a Debian GNU/Linux workstation (rather than just the servers) and be able to work on it directly using Emacs. About time I got back to finishing off some coding projects at home.. Maybe its time to clean up the Book Catalog and upload it. And back into packaging for Debian. Actually, that might not be a bad idea, given one of my junior workmates is applying to become a Developer. Wooo hooo.

Another year another entry.

Am working at a new place again. Mostly a programming job for the network services department of a fairly large ISP.

The world is all good.

Recently?

Dealing with lots of crap from the Melbourne office of the company. The guys there are useless pieces of crap. Even more arrogant than I am, and know far less (given they rang me up to fix a problem they had pinging across a previously working gateway machine I know we are in safe hands in that office)..

Bought myself a laptop. Installed Debian GNU/Linux on it. Quite a nice install once I got X working and sound working (that took a bit longer).. Thankfully Intel provided free driver source for both the video card and the network card. Eventually I sorted out ALSA and got the audio working really sweetly. And once my creditcard works happily once more I'll get more ram for it and a wifi interface.. Only real fault with the damn thing is that it 'freezes' for 1 or 2 seconds now and again. Although the XP install on it does that too so it might be a hardware fault (bah!).

I really need to consider finding better paid work with more incentive for being at work. The morale here sucks (the CEO has his pets and treats everyone else like shit) and I know I am very underpaid for the work I do (although admittedly my income isn't unhealthy). So tempted to go back into R&D or pure development. Or maybe purely network management, am sick of having to handle client installs of our products (especially the legacy pieces of shit our salesfolk keep selling)... mmmm networks...

Beannachdan oirbh.

Gods, how long since I last posted here? Of course, I could blame LJ on that. Given that I use LJ for most 'online journal' type activities (and my IAM.BME page).

What has been happening? Dropped Debian developer status for a bit. Needed a break from overly technical stuff. Got a job at a fairly good company. Positive share growth, positive cash flow. Heck, they have employed me since feb. so it can't be all bad. Except for morale :(

Got tonnes of tattoos recently *smirks* and piercings and stuff. Been buying a tonne of books. Plenty of little userlevel hacks on my machine at home, primarily a book / resource management system and an image catalog database..

Na Diathan leibh.

Bored, not working. No job, and nothing in the market it seems.

Bored enough to totally rewrite the website and database for http://cyberpunks.org. Runs faster now, looks nicer, has user accounts. Drinking much mead, but thats okay. Fixed bugs in mathwar, and working on packaging the new xconq for the testing/unstable/foo release. Maybe i should start playing xconq again, as my machine seems to be degrading and cant play many other games. However, I do have the definitive triad of horror movies now on DVD, The Exorcist (extended version), The Omen and Rosemary's Baby. That coupled with my growing collection of definitive sword movies (Braveheart, 13th Warrior, soon Beowulf...) I should be in good stead. Beannachdan oirbh.

In the idle time between mid-December, and early January, whilst waiting for the hiring to be done again, I got bored. Perfected my image catalog (well, my script to add images is buggy, it freaks on spaces in filenames, but since most of my image store got renamed a year ago, its not too much of a problem).

And then I got really bored, and started working on a book catalog system. Fully searchable, catagorized book collection, about 200 books in and still typing (books can also be defined as wishlist and on order.). The final addition for it will be cross-linking book extracts to the entered titles (take notes from a book, and have it automatically linked when you search for the title), and ability to cross reference scans (images) to each book title.

Not much else to do, except wonder what happened to my Gimp install. One day it decided it was not going to display anything that involved a font (only showed dotted boxes instead of characters), upgraded it, same thing. Removed dot-directories and files, still happening. Was not happening to any other gtk based application. Bitched at the machine for a day (i have had huge and random font problems recently), tried to rerun the Gimp, and it all worked fine.

Oh well, got made reduntant 4th of October, and due to the loving tech industry at the moment, there aint any jobs out there.

Got to the stage of using up all my payout to live, and now on government payments (*sucks*) and blanket mailing companies in order to find a position anywhere.

19 older entries...