Tuesday 27 July 2010

Marine Mobile

The nearly new FT817, the Walkabout Antenna and the Palm Radio Paddle give me the opportunity to combine two of my hobbies: Sailing and Radio.

Last weekend I made an interesting trip from Southsea Marina to Cherbourg and on to Alderney, the most northerly of the Channel Islands. I was sailing on my friend Neil's Westerly Discus CC, "Beatrice Rose", seen here riding on a mooring in Braye Harbour, Alderney in the fog on Sunday morning...


We made the crossing to Cherbourg via Bembridge Ledge, E of the Isle of Wight. Here's the East Cardinal mark which protects shipping from the Ledge (with the chalk cliffs behind Princessa Shoals beyond)...


... and here's the entrance to Cherbourg Marina...


We stayed over a night in Cherbourg - just time for a nice meal at L'Antidot and a trip to Carrefour to get victuals for the boat and presents for the XYLs. Then on to Alderney, some 25 miles W, seen here as we approach from the NE...


We spent two nights riding a mooring just below the Admiralty Breakwater in Braye Harbour (see the picture at the top of this post, taken from the water taxi).

During this break from sailing I operated m0xpd/mm for the first time...

I discovered that there's a LOT of qrm in the vicinity of boats. After turning off Beatrice Rose's fridge, this was reduced to a manageable level and I was quickly able to work fellow FISTS member Fred, m0icw, Piet, pa3aff, Roy, 2e1raf/qrp and Fred, dj5di...


There are many joyful sights to see whilst sailing - skies, seas and pretty ladies. Here are two particularly pretty ones who spent the night with us - a Schooner (left) and a Brigantine, both seen riding at anchor...


We saw the schooner under sail - she appeared to have a gaff-rigged sail on her foremast and a Bermudan on her main (although it may have been a gaff main with a tops'l). I would love to have seen her flying jibs and stays'l.

A horribly early start from Alderney saw us back at the entrance to Langstone Harbour in the early evening - from where we could see the Portsmouth skyline to the West, with the conspicuous Spinnaker Tower...


All in all, a great (191 Nm) trip (thanks Neil) and great fun operating /mm - I'll certainly be doing more of that.

...-.- de m0xpd

Tuesday 13 July 2010

Biting off more than you can chew - almost

I finished Challenge Three of Pincock and Frary’s “Code Breaker” hoping that the next Challenge would have more meat on the bone – indeed it did turn out to offer a more substantial meal!

Challenge Four is a series of three messages encrypted in “ADFGX” cipher.

Cracking this cipher requires knowledge of two things; the randomized Polybius grid (by which each of the letters of the alphabet in the message are represented by a pair of the codes [A,D,F,G,X]) and the key (used to transpose the resulting sequence of codes, making decryption (by e.g. frequency analysis) more difficult).

As the book presents an insufficient sample of ciphertext messages to hope to crack the ADFGX cipher of challenge 4 from scratch, I made the assumption that:

  • we probably know the key word already
  • we must have access to the distribution of letters in the Polybius grid
I started by working on a program which took the ciphertext sequences and arranged them into a grid, assuming a certain key word…

Here's the raw ciphertext for the first part of the challenge…

XAGAXDFAFGFAXGDDFFDDADXGGDFAFFDFFAGAXXDAAXFFXGAXFDFAF
GFGDAAFADADAXAAGXAADFDFFGFFAGADXDDDGAAAAFAAAFXAAAAG
AAAGAAFAFFGGFDAFDDFFFDFDAFFFAXFADFDFFDFFAXXDDFFGAFADFG
DXDADAAGAAFDGFGFAA

It has 176 characters suggesting (since characters of the plaintext are represented by a PAIR of ciphertext codes) a plaintext message of 88 characters. The 176 characters have to be arranged into a grid, according to a key word. The grid will have the same number of columns as the number of characters in the key and, given the ciphertext length, will have a certain number of rows, INCLUDING SOME POTENTIALLY INCOMPLETE ROWS. The number of columns, number of complete rows and number of complete columns all can be calculated from the key length and the ciphertext length ("l")…


Given that we know the number, n, of complete columns, those particular columns which are complete are the first n columns of the un-transposed sequence and these columns can be tracked through the transposition with reference to an alphabetical sorting of the key. We know the ciphertext, we have an algorithm to arrange it and undo the transposition – but WHAT’S THE KEY?

Well, having coded the algorithm (in MATLAB) I decided to use the 5 * 5 arrangement of letters of the alphabet (with single square for i/j) in the Polybius grid on page 94 of the book…

F N W C L
Y R H I V
T A O U D
S G B M Z
E X K P Q

This allowed me to test for a correct key word, just by seeing if the program produced meaningful plaintext output.

After a few experiments with random key words (like “KAISER” from the example on pp 94 – 95, “ALBERTI” from the solution of Challenge 2 and simple sequences like “ABCDEF”, to test if there actually hadn’t been any transposition) I tried “STAGER”, the solution of Challenge 3.

Here’s the resulting transposed sequence…


AEGRST
------
XFADFX
ADFGDD
GFAAAD
AFDAFF
XAAADF
DGDADG
FAAFFA
AXXAFF
FXAAFA
GDAADD
FAGFFF
AAXXDG
XXAAAD
GFAAFX
DFDAFD
DXFAFA
FGDGAD
FAFAXA
DXFAFA
DFGAAG
ADFGDA
DFFAFA
XAAADF
GFGFFD
GGAAFG
DFDFDF
FGXFFG
ADDGFF
FADGAA
....XA

And here’s the result of “undoing” the transposition by sorting the columns according to the correct spelling of the key on the first row…

STAGER
------
FXXAFD
DDAFDG
ADGAFA
FFADFA
DFXAAA
DGDDGA
FAFAAF
FFAXXA
FAFAXA
DDGADA
FFFGAF
DGAXAX
ADXAXA
FXGAFA
FDDDFA
FADFXA
ADFDGG
XAFFAA
FADFXA
AGDGFA
DAAFDG
FADFFA
DFXAAA
FDGGFF
FGGAGA
DFDDFF
FGFXGF
FFADDG
AAFDAG
XA....

Obtaining the plaintext is then simply a matter of reading off the rows and columns from the Polybius grid – for example, the first pair, “FX” refers to row 4, column 5, which returns the letter ‘D’...

The entire plaintext of the first part of the challenge is…

Dearwinstonthefirsttwolettersyouwillneedstartthenameofthecitywiththefamousshroudboniface

Which we can easily “punctuate”, to reveal the fictional “Letter”, as follows…

Dear Winston
The first two letters you will need start the name of the city with the famous shroud
Boniface



The remaining two “letters” are decrypted in the same manner (they used the same key etc)…

Dear Winston
The next two letters stand for the us state where you will find the naval undersea warfare center
Boniface

Dear Winston
Nazi Germany initially.
Boniface


Solution doesn’t require the skills of a crossword puzzle addict (just as well, for I'm not into puzzles at all - in fact all this code breaking stuff is fast turning into a bit of a chore). Turin is famous for its shroud, a quick search on the ‘net reveals that NUWC is headquartered in Newport, Rhode Island and the initals of Nazi Germany are there for all to see.

We conclude that the answer is “TURING” – entirely fitting as it is the family name of the tortured English genius, for whom a street in Manchester is named!

Initial looks at Challenge 5 reveal much more of a problem and a mistake in the book - more on that later.

...-.- de m0xpd

Sunday 11 July 2010

Stooping to the Challenge

Challenge 3 in Pincock and Frary's book is trivial compared to the previous two - but I'll record the solution here for completeness.

The message is presented in "Union Route cipher" as follows...

Guard this reveal every great avoided this some cowboy historians straightforward enemy efforts rows the fills turning table need to read their obfuscation that saucy contended for despite just initial you the nonsense up clue first now attacks technique have emptiness

Solution involves the trivial task of re-ordering the words into a 5*7 array (the initial word "guard" indicates the pattern of this re-ordering)...

The message is shown in black, the "null" words are shown bracketed in grey and the filler words (used to pad out the array to completion) are in blue.

Reading the message indicates that we're to look at the first initial of every row to reveal the clue we need - shown here in the red box...

"Stager" is the family name of Anson Stager, influential in the development of the Union Route cypher.

I hope Challenge 4 will have a little more meat on the bone!

...-.- de m0xpd

Crypt Kicking

Having returned from the recent adventures in HB-Land, I was keen to have a play with the "Challenges" in the Appendix of Pincock and Frary's book "Code Breaker"...



There are some websites which give the solutions, but I'll show enough of my working to prove that I've actually cracked the codes!

Challenge 1

We are told that the first Challenge is enciphered using a simple Ceasar shift.

Here's the ciphertext...

AXQTGINUGTTSDBINGPCCNXHSTPSGJCWTCRTEGDRAPXBRGNXIP
QDJIIWTHIGTTIHHDBTIDIWTRDBBDCEJAEXIHPCSRGNDJIAXQTGIN
UGTTS DB PCSTCUGPCRWXHTBTCI ETDEATPCS HTCPI DG HQTCDIPUU
GXVWITSUANCDIHIPCS[HXUUPBQXIXDCHSTQIXHEPXSIWTLDGSH
DURPTH PGQTUDGTWTUTAALXAADETCIWTCTMISDDG


I wrote a function in MATLAB to perform Frequency Analysis on the ciphertext and here's the result...

There is the strong set of peaks which would be expected from a mono-alphabetic substitution (such as a Caesar shift). What's more, the modal peak at "T" in the ciphertext is likely to correspond to the plaintext character "E", suggesting a 15 (or 11) character shift. If we make such a shift, the following plaintext emerges...

LIBERTYFREEDOMTYRANNYISDEADRUNHENCEPROCLAIMCRYITABOUTTHESTREETSSOMETOTHECOMMONPULPITSANDCRYOUTLIBERTYFREEDOMANDENFRANCHISEMENTPEOPLEANDSENATORSBENOTAFFRIGHTEDFLYNOTSTANDSTIFFAMBITIONSDEBTISPAIDTHEWORDSOFCAESARBEFOREHEFELLWILLOPENTHENEXTDOOR

Here's the Frequency Analysis of the plaintext...

... which follows that expected in English (see, e.g., the distribution on page 38 of Code Breaker or on the Wiki page)

We can break up words and phrases by adding spaces and carriage return/line feeds "by inspection"...

LIBERTY FREEDOM TYRANNY IS DEAD
RUN HENCE PROCLAIM CRY IT ABOUT THE STREETS

SOME TO THE COMMON PULPITS AND CRY OUT
LIBERTY FREEDOM AND ENFRANCHISEMENT

PEOPLE AND SENATORS BE NOT AFFRIGHTED
FLY NOT STAND STIFF AMBITIONS DEBT IS PAID

THE WORDS OF CAESAR BEFORE HE FELL WILL OPEN THE NEXT DOOR


It doesn't take too much effort (e.g. cutting and pasting into Google) to track the first six lines to Shakespear's Julius Caesar, Act 3, Scene 1.

The seventh line, above, suggests that we find the words of Caesar "before he fell" - these last words are uttered immediately before the extract above: "et tu Brute".

Challenge 2

The second challenge is tougher - we are told it is cast in a Vigenère cipher.

Here's the ciphertext...

HXLNSFSXHMGMQPQYKSRBGYTRWDIHBGHJEYMLVXXZPLLTRHTGHFOY
WFCYKUOTYBRIBZBUVYGDIKHZJMYMLMLIISKWBXCPAITVJTXVHGMBZH
MMWLMDPYHMLIUTJUZMMMWTM
ZPLLMCJHNLUNYGXCYBPFEYBKLMYC
GKSLMBXTHEZMMLIUBLUYJEEGXHZERNHWJKBYOUQASWXYUN
ZFRREFXSPLHXIHMHJSFWXIH


I wrote another MATLAB function to find repeats of 2,3 and 4 letter sequences within the ciphertext and the spacing between such repeats. The results are as follows...

Two-Character repeat spacings...
213 216 174 97 106 208 91 40 142 9 21 46 189 198 18 188 146 117 45 45 47 81 135 90 90 171 90 90 85 90 39 72 108 77 2 36 90 29 52 73 80 34 88 34 88 74 54 59 9 111 17 18 62 18 23 44 51 102 54 54 54 45 1 45 44 81 21 28 36 62 38 5 7 24 9 9

Three-Character repeat spacings...
45 90 90 34 88 18 54 54 45 9

Four-Character repeat spacings...
90 54

For clarity, I've highlighted the first pair of four-character repeats "ZPLL" in the ciphertext above. The second four character repeat involves the sequence 'MLIU'.

If we look at the repeat spacings above, we can see a lot of repeats separated by multiples of 9 places, suggesting a 9 character key for the Vigenère cipher.

This is emphasized if we look at the distribution of the (two character) repeat spacings divided by nine in modulo-9 division...

OK - so we suspect a 9-character key. But what is it?

If we look back to the first challenge and remember we were told that Caesar's last words "will open the door", we note that "et tu Brute" has nine characters, so we'll try that as the key...

Here's a plain alphabet (first row) and 9 shifted alphabets associated with the "ettubrute" key (you can see "et tu brute" in the first column)...

ABCDEFGHIJKLMNOPQRSTUVWXYZ
EFGHIJKLMNOPQRSTUVWXYZABCD
TUVWXYZABCDEFGHIJKLMNOPQRS
TUVWXYZABCDEFGHIJKLMNOPQRS
UVWXYZABCDEFGHIJKLMNOPQRST
BCDEFGHIJKLMNOPQRSTUVWXYZA
RSTUVWXYZABCDEFGHIJKLMNOPQ
UVWXYZABCDEFGHIJKLMNOPQRST
TUVWXYZABCDEFGHIJKLMNOPQRS
EFGHIJKLMNOPQRSTUVWXYZABCD

Decoding the ciphertext according to this scheme was achieved by another simple MATLAB function I wrote ("viginere.m" - nothing pretty, but saves the ball-ache of doing it "by hand")...


Sending the (uppercase) ciphertext and key strings to the function returns the following plaintext...

DESTROYEDINTWOZERONINESACKEDINNINETHREEFOURANDANNEXEDBYFRANCEINEIGHTEENZEROFIVETHISPORTCITYWHOSEPATRONSAINTISSTJOHNTHEBAPTISTISATFOURTYFOURTWENTYFIVENEIGHTFIFTYSIXEANDISTHEBIRTHPLACEOFDATOSFRIENDWHOSEFAMILYNAMEYOUNEEDTOPROCEED

... which again is "punctuated" by inspection...

DESTROYED IN 209 SACKED IN 934 AND ANNEXED BY FRANCE IN 1805
THIS PORT CITY WHOSE PATRON SAINT IS ST JOHN THE BAPTIST
IS AT 44 25 N 8 56 E
AND IS THE BIRTHPLACE OF DATOS FRIEND
WHOSE FAMILY NAME YOU NEED TO PROCEED


Entering the coordinates into Google Maps will reveal the city as Genoa (Genova), whilst the historical dates of destruction, sacking and annexation, as well as the Patron saint, are confirmed in (e.g.) this Wiki page.

As yet, I haven't had time to figure out who "Dato" or his(/her) friend is - so this remains a work-in-progress!

...-.- de m0xpd

Update:-

OK - Leonardo Dato, secretary to the Pope, was friend of Leon Battista Alberti. I found this by poking about on the internet - but I'm ashamed to say it is in the book! Pages 41-42!

Guess I'm ready to move to the next challenge...

Smoke on the Water

Time for some more travelogue - this time about last week's frolics in HB-land...


We all came out to Montreux, on the Lake Geneva shoreline
To make records with a mobile, we didn't have much time
Blackmore, Gillan, Glover, Lord, Paice

Well - to be precise, we came out to Geneva on sleazyJet EZY1953 and then onward to Lausanne. The weather was HOT and uncomfortably humid - the heat persisted throughout the week but, mercifully, some of the humidity subsided.

Lausanne (or, more properly, Ouchy - the "district" of Lausanne next to Lake Geneva (a.k.a. Lac Leman)) is a hub for the ferries of the Compagnie Generale de Navigation sur le Lac Leman.


We took a ride to Evian, on the south bank of the lake, opposite Lausanne, famous for the eponymous bottled water, which emerges from a spring near Evian.


We found a nice Creperie, run by some very nice boys from Brittany. The place was called "Ar Gedez", which (I am led to believe) means "Equinox" in the Gaelic language common to Bretons, Irish, etc.. You will get a flavour of the place from the facts that
  • my galette was topped with foie gras ice cream and fig conserve
  • the cidre bouche was from a numbered bottle
Of course, being in Evian, we also had some of the local water - I must say, it tastes like decent tap water to me!

Return trip from Evian to Ouchy was on the paddle steamer "Rhone" (Lac Leman is on the Rhone), which had a strange faltering gait - as if there was an imbalance in torque at the paddle wheels from the engines.

I'd forgotten what paddle steamers felt like - not that my experience of these craft is extensive. I remember taking trips from Bournemouth to Swanage on Waverley as a child and am pleased to have seen Waverley still plying her trade whilst I was sailing the Clyde in 2007...


The next day we followed Deep Purple "out to Montreux", this time travelling on P/S "La Suisse", whose motion was plus doucement than her sister "Rhone".


These boats are beautifully kitted out, as you can see from Suisse's dining saloon...


It is worth paying the (c.35%) extra for first class tickets to get the run of the boat - the first class seats offer a much nicer view!

We were on our way to Montreux to visit the Jazz Festival, which is much to be recommended. Travelling to the festival on a 90 minute trip through heavenly scenery on a beautiful paddle steamer only adds to the sense of joy.

We had tickets to see The Pat Metheny Group's gig in the Miles Davis Hall, which was part of their "Songbook Tour". The XYL and I have been Pat Metheny fans since the old days, having last seen them play in London on the Still Life (Talking) tour, 1987.

Verdict: In a word, brilliant! At certain points, verging on a spiritual experience (perhaps most dramatically, when Pat was playing the Pikasso Guitar, which (with an octave doubler sound on the bass) filled the hall like the 32 foot stops of an organ.) The set started with "Phase Dance" (my favourite Metheny Group Track) and included a great version of "James". The loss of drummer Paul Wertico was news to me (shows how out-of-touch I can be). Wertico has been replaced by Antonio Sanchez, who did much more than just occupy the drum stool (I liked the way he kept all his solos in tempo - makes the music more accessible to non-musos).

We took a return visit to the Festival the next day, travelling by train to save cost and time!

Throughout the trip I read Code Breaker by Stephen Pincock and Mark Frary...



... which I had been fortunate enough to pick up (in un-opened condition) at the Stockport Rally last weekend for two quid. A very entertaining read.

I finished the last few pages on the flight home (Sleazy 1952), when I was delighted to find some "Challenges", in which the reader is invited to put what they've learned into practice by cracking some ciphers - but that's a different story!

...-.- de m0xpd

Monday 5 July 2010

Jumping the Ditch

Initial overnight testing of the totally H/B WSPR rig left me a little disappointed - but that didn't deter me from leaving the system switched on last night.

I was pleased to see better performance...


Still getting solid spots from la9jo in arctic Norway, but also a gratifying 6822 km to Douglas, w3hh, in Florida.

It is especially good to see this result from a totally H/B rig, including local WSPR signal generation! Why, even the shack computer wasn't powered up (I couldn't have used it if I'd wanted because, as regular readers will recall, it suffered a terminal hard disk crash last weekend).

Now I'm off to HB-land for a while to take in some of the Montreux Jazz Festival, so the Blog (and the Beacons) will be QRT for a while.

...-.- de m0xpd

Saturday 3 July 2010

Frequency Stability & Palm Trees in Stockport

Having reported making a start on the PCB-based version of the WSPR generator last week, I'm sorry to have to report today that the completed system was a great disappointment.

You can see the board here...


It worked - but not very well.

I found the AF oscillator to have very poor frequency stability (much worse than the initial version on the Breadboard).

In trying to track down the origins of the problems, I also discovered that the entire oscillator is (in my opinion) a bit "dodgy". The first cut of the circuit on the PCB didn't run at all - I found that this is due to a sensitivity to power supply voltage (which needs to exceed 10V for some embodiments of the circuit to oscillate reliably - my Breadboarded version was the exception rather than the rule in being able to run at 8V). The performance is a strong function of supply voltage - below a critical point (~8V) the oscillator doesn't run at all then, on increasing the supply voltage, it runs but with an irregular output (a sort of chaotic fluctuation modulating the desired periodic output). Pushing up the supply voltage still further (11 - 12V to be sure) takes the system into stable periodic behaviour.

Even once I'd realized that the supply needs to be high enough to get reliable oscillation, I still couldn't get any long-term frequency stability on the PCB-based version - so I gave up!

I turned my attention back to the breadboard version and connected up the minimum sufficient number of elements from my increasing collection of "beacon building blocks" (strictly, that's not true - I didn't need the bandpass filter, but it was already connected between mixer and amplifier, so I just left it there)...


There's (left to right) the WSPR Generator, the SDR-Kits USB Synth, the Mixer, the BandPass Filter, the 'Radio Times' Amplifier and the LowPass Filter. I turned on and was immediately rewarded by a spot from Reimund, DL6YCU...


The plan now (that I've learned the nuts and bolts from Gene Marcus, w3pm's design) is to program my VCXO-based system to generate the WSPR signal - I KNOW that has very much better frequency stability from the results I've achieved with QRSS and S/MT Hell. In fairness, Gene does offer a similar solution on his excellent WSPR Projects Page.

Today was the Stockport Radio Society's First Stockport Rally (the continuation of the annual event that used to be called the Reddish Rally). Usual mix of junk, amidst which I was delighted to find a Palm Radio Mini Paddle...


... which I picked up in "as new" condition for thirty quid. Not a bad deal, as Martin Lynch are today advertising them at £75.96.

Here's the new paddle atop my nearly-new FT 817...


Regular readers of these ramblings (haven't you got anything better to do) will remember I've been drooling over these keys for ages - ever since seeing Juan, ea5elp's videos of working /p on the beach. Great result - I look forward to the second Stockport rally !

...-.- de m0xpd


Update :-

I left the system on overnight and got the following outburst of acne (what else is the collective noun for a bunch of spots)...


Nothing too impressive (certainly not as good as previous H/B WSPR attempts) but proof of some limited level of success. Best dx was 2043 km to la9jo in arctic Norway.