Quantcast
Viewing all articles
Browse latest Browse all 2548

8-bit acorn software: classic games • Re: CABALIST - a challenge....

WALKTHROUGH PART 15 — PROGRAM "QWERTY"

CHAIN "QWERTY"

We are told the text has been encrypted using the codeword 'BYRON'.

The encrypted text looks like this:

=H>{f5}E8EM{f5}7BRHD{f4}2S{f8}H:0AK::-{ff};O{f4}<OF;{f4}*S{f8}{f5}{f4}=H>{f5}7.SM{f5}:7GE?H1{ff}E7C0U:=:{e8}PH;I{e8}O?{f5}65L{f8}{f5}{f4}=IF;{f4}

As usual, we start by looking for patterns.

The text is a mixture of letters, numbers and punctuation.
Once again the high-value codes, {f4} {f5} {f8} etc, look like word separators.

Here is the same text with high codes substituted with spaces for readability:

=H> E8EM 7BRHD 2S H:0AK::- ;O <OF; *S =H> 7.SM :7GE?H1 E7C0U:=: PH;I O? 65L =IF;

To make things easier we will lay out the encrypted text next to the codeword BYRON to see how the characters match up:

Code:

B Y R  O   N B Y R  O   N B Y R O  N   B Y  R   O N B Y R O N B  Y   R O  N= H > {f5} E 8 E M {f5} 7 B R H D {f4} 2 S {f8} H : 0 A K : : - {ff} ; O {f4}B Y R O  N   B Y  R    O    N   B Y R  O   N B Y R  O   N B Y R O N B  Y< O F ; {f4} * S {f8} {f5} {f4} = H > {f5} 7 . S M {f5} : 7 G E ? H 1 {ff}R O N B Y R O N  B   Y R O N  B   Y R  O   N B Y  R    O    N   B Y R O  NE 7 C 0 U : = : {e8} P H ; I {e8} O ? {f5} 6 5 L {f8} {f5} {f4} = I F ; {f4}
Notice how each letter of the codeword matches against just one of the high-value codes:

B : {e8}
Y : {ff}
R : {f8}
O : {f5}
N : {f4}

Also notice that the numbers match the position of each codeword character in the alphabet:

Code:

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Ye7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff   ^                                   ^  ^        ^                    ^
From this we can deduce that the codes all represent the same character, likely to be a space.

Next, we need to determine whether the encryption technique is using addition/subtraction or exclusive-or.
Let's do some calculations on the word separator codes:

&E8 - ASC"B" = 166 ... &E8 EOR ASC"B" = 170
&FF - ASC"Y" = 166 ... &FF EOR ASC"Y" = 166
&F8 - ASC"R" = 166 ... &F8 EOR ASC"R" = 170
&F5 - ASC"O" = 166 ... &F5 EOR ASC"O" = 186
&F4 - ASC"N" = 166 ... &F4 EOR ASC"N" = 186

The numbers for minus are the same while those for EOR are different.
We can therefore deduce that the encoding must be using addition not EOR.

Now we need to turn our attention to the content of the message.

The words are a mixture of upper case letters, numbers and punctuation characters.
If we look at the relevant part of the ASCII character set we can see a pattern:

Code:

                             original text                       v------------------------v*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^------------------------------------------^               encrypted text
The letters in the encrypted message appear to have been shifted downwards.
This suggests an offset has been subtracted from the characters.

Look at the first word of the encrypted text. We can see a 3 letter word '=H>'.
This sequence of characters appears again later in the message.
A 3-letter word at the beginning of a sentence. Could this word be THE?

If it is THE, notice that the second letter in the encrypted text, '=H>', is 'H'.
Could it be that where there is a 'Y' in the codeword, the letter in the message is unchanged?

If this is the case, it means there is an offset of ASC"Y" (89) subtracted from each character.
The 'Y' in the codeword minus the 'Y' offset results in 0 being added to the original letter, ie it remains the same.

Putting together the letters we think we know gives us this:

THE --E- --R-- -S ---A---- -- -O-- -S THE --S- --G---- ----U--- P--- O- --L -I--

Can we find any more clues?
Let's look for 1 and 2-letter words.

There are no 1-letter words.
There is a two letter word '-S' probably AS or IS.
There is a two letter word 'O-' probably one of OF ON OR.

Now we can start to try decoding some of the text.

We think that the keyword is being added and an offset of ASC"Y" (89) is being subtracted.
encoded_char = ASC(char) + ASC('BYRON') - ASC"Y"

Since we have the most confidence about the word separator characters let's start there.
The first word separator is {f5} which is encoded using the character 'O' from the codeword.

To decode we have to reverse the operations, ie add the offset ASC"Y" and subtract the codeword character.

&F5 + ASC"Y" - ASC"O" = 255

Not the space character (32) we were expecting, but remember in the previous program the block character (255) was used as a word separator rather than space.
The use of the block character here would be consistent.

Let's try decoding one of the two-letter words using the same method.

There is an encrypted word '2S' encrypted by the start of the codeword 'BY'.
We suspect the 'Y' in the codeword leaves the encoded character 'S' unchanged.
We want to decrypt the '2' using the codeword character 'B' and the offset ASC"Y".

ASC"2" + ASC"Y" - ASC"B" = 73 ... the ASCII code for 'I'

This would make the original word 'IS'.
Again, we have a sensible result.

Let's write a program to try decoding the text using this technique:

Code:

NEW   10 C$="BYRON"   20 A$="=H>"+CHR$&F5+"E8EM"+CHR$&F5+"7BRHD"+CHR$&F4+"2S"+CHR$&F8+"H:0AK::-"+CHR$&FF   21 A$=A$+";O"+CHR$&F4+"<OF;"+CHR$&F4+"*S"+CHR$&F8+CHR$&F5+CHR$&F4+"=H>"+CHR$&F5+"7.SM"+CHR$&F5   22 A$=A$+":7GE?H1"+CHR$&FF+"E7C0U:=:"+CHR$&E8+"PH;I"+CHR$&E8+"O?"+CHR$&F5+"65L"+CHR$&F8+CHR$&F5+CHR$&F4+"=IF;"+CHR$&F4   30 FOR I%=1 TO LEN(A$)   40 A%=ASC(MID$(A$,I%,1))   50 A%=A%+ASC"Y"   60 A%=A%-ASC(MID$(C$,(I%-1) MOD LEN(C$)+1,1))   70 VDU A%   80 NEXT:PRINT
Line 50 removes the offset value.
Line 60 decrypts using the codeword.

RUN the program and the decrypted text is revealed:

THE POET BYRON IS REGARDED BY SOME AS
THE BEST ENGLISH LANGUAGE POET OF ALL
TIME

Statistics: Posted by dv8 — Wed Nov 27, 2024 11:57 am



Viewing all articles
Browse latest Browse all 2548

Trending Articles