Click to see full photo

Keith Lockstone's home page

Cryptographic material

Here are some comments on 4-Strand Luby-Rackoff schemes that seem to explain some of the odd ways that certain candidates for the AES competition approach their Feistel structures.

Some thoughts on Steganographic Protocols show how plaintext bits can be embedded in random files.

Here is a protocol for padding both ends of a ciphertext:  Bookends.

For the Postscript challenged, here's an acrobat version of David Wheeler's WAKE paper - plus his 3 papers on TEAtea.pdfxtea.pdf  and  xxtea.pdf.  David has produced some test vectors for TEA and XTEA.

For on-line viewing, here's the HTML version of WAKE and some notes and sketches showing WAKE features. David has also answered some questions on WAKE and approved an extended version called Hereward that uses 8 tables.

Next, a real piece of history, the cover and 22 pages scanned from British Cypher No. 5.  This inspired some thoughts on The 'One-Time Codebook': a modern interpretation of codebooks.

The Message Authenticator Algorithm is, as far as the author is aware, the first Cryptographic Hash Function or Message Digest to gain widespread acceptance.  It has become a part of ISO standard 8731-2: Approved Algorithms for Message Authentication.  The designers were Donald Davies and David Clayden.  As it seems to be unavailable in electronic form, here's an on-line version and a .pdf version.  See appended notes for extra material.

Caveat Encryptor

A talk given by Sir Harry Hinsley to Cambridge University's Security Group on the use of Ultra during WWII.

Lastly, articles on how 3 U-Boats were caught by deep laid mines off Padstow as a result of Ultra intelligence.

Amateur Radio - Antennas

Antenna Matching

One of the perenial problems of Amateur Radio is that of antenna bandwidth.  The worst example of this in the HF bands is the 160 metre (1.81 to 2.00 MHz) band.  It's common to express antenna bandwidth as the band between the points where the SWR is 1.5 or less compared with the centre of the band.  In the case of 160 metres this is 10%.

The antenna behaves like a tuned circuit and, when power is applied, the reactance of an off-tune antenna causes power to be reflected back down the feeder (coax) back to the transmitter.  If the transmitter's final drive stage has no protection, as in the case of very old or cheap equipment, then damage to the final drive stage is likely.

Faced with this problem in the 1980's an experiment was done that used stubs attached to the antenna feedpoint.  These were in multiples of a quarter wavelength.  Odd multiples were closed-ended stubs and even multiples were open-ended.  Although stubs look like tuned circuits electrically, the reactance changes in the opposite direction to that of a tuned circuit, so it can be used to cancel the reactance of an antenna.

In the particular case tested, the results showed a dramatic improvement in SWR figures.  However, further analysis is needed - in particular to establish if the improvement led to more power being tranmitted.

One Wavelength Loops

As a matter of curiosity a number of simulations were run, using EZNEC+, to look at the properties of rectangular loop antennas with a perimeter of one wavelength.  These results are not normally shown in the antenna books and point to a different approach to designing Quad/Yagi antennas that require good bandwidth.  For reference, the same runs were done on both dipoles with droopy ends and double loops.

A Thoughtless Hijacking of Internet Resources by the DWP

A scan of the full 51.x.x.x IP address range showed that the Department for Work and Pensions has over 13 million IP addresses allocated to it.  This is 0.31% of the global IP address space or 1 in 5 of the UK population.

Embedded Microprocessors - ADC Conversion without division

Small embedded microprocessors such as PICs and AVRs often have 10-bit ADCs whose outputs need to be converted to recognisable units such as millivolts, degC etc.  Ideally, the conversion process should involve adds, multiplies and shifts only.

One of the problems is due to the range of ADC values - 0 to 1023.  This means division by 1023 or a multiple of 1023 somewhere in the maths.  This can be circumvented by scaling up the equation by 1024/1023, simplifying and then changing the remaining 1024/1023 factor to 1025/1024. 

The difference between 1024/1023 and 1025/1024 is less than 1 ppm which is an acceptable level of error.  Here is the math describing the process and a spreadsheet to allow inspection of all ADC output values and experimentation.

MPL115A Pressure Sensor (Freescale Semiconductor) - Application Note Error

See Freescale Semiconductor Application Note AN3785, Page 18.  The line:

    siPcomp = ((S16)lt3>>13); // goes to no fractional parts since this is an ADC count.

should read:

    siPcomp = (S16)(lt3>>13);

so that the 13-bit shift acts on a 32-bit variable, not a 16-bit one.

Using the same sort of math, this 32-bit variable can be converted to kPa using just shifting and addition.  A spreadsheet is available to allow inspection of all values and experimentation.




A poem by Charles Causley that reflects the human condition.  (He served in the Royal Navy in WWII - as a Coder, First Class)




If you work in an open plan office you'll appreciate that sometimes concentration is difficult.  One of my previous employers thought that the problem could be solved by wearing hats.


Beware of the work virus - it could ruin your day.

For those with a keen interest in espionage, here are some photos of a dead letterbox.

Description of a computer illiterate: Someone who can't tell his ASCII from his EBCDIC.



Has your life ever been made miserable by a psychopath/sociopath?  Most people have suffered at the hands of a perverse personality at sometime in their lives, be it in the workplace or at home.  It may take years before the lovable glib mask is penetrated and the destructive side exposed.  An estimated 1 in 25 of the population are sociopaths - which means that we all know a few.  Journalist John Simpson's description of Robert Maxwell is a good illustration.

In a book review on Psychopathy by Millon et al, the reviewer quotes: ". . . it was not until Cleckley wrote The Mask of Sanity in 1941 that we came to realize that psychopathy is a personality disorder that wreaks havoc on personal and societal institutions.  As reported in chapter 8, Westman estimates that each sociopath costs society about $50,000 a year."  The case of Robert Hendy-Freegard is one of the worst ones to emerge recently.

This extended excerpt from a book by Martha Stout gives a stark insight into the mindset of this type of personality.  When read slowly and carefully it can form the basis for understanding the phenomenon.  Notes include warnings from religious texts as well as modern scientific findings involving DNA markers and brain scans.


Have you ever fallen foul of a cosy clique of callous critics?  You may be facing a phenomenon known as Groupthink where a group of people who may seem OK on an individual basis act in a perverse way in a group context.  The group can range from the local parish council up to a national government.

The inept handling of outgroups and indiviuals by the ingroup is matched by the inept way the ingroup deals with its own situations.  This can only be remedied by positive dissent from within the ingroup.

Irving Janis, a research psychologist from Yale University has written a number of books on the subject such as Groupthink: psychological studies of policy decisions and fiascoes where he dissects and compares situations such as the Bay of Pigs fiasco with that of the Cuban Missile crisis.

A body of men holding themselves accountable to nobody ought not to be trusted by anybody — Thomas Paine

© 2014  Keith Lockstone

Comments to:  Keith

This page has been visited     times. AES,block,CAST-256,cipher,cypher,crypto,cryptography, WAKE,TEA,steganography,cipher design,encryption,Feistel,Friedman, Luby-Rackoff,MARS,RC6,Twofish,czczcz,bookends,Harry Hinsley, Enigma,Colossus,Ultra,Bletchley Park,Max Newman,Alan Turing,Bombe,Welshman, GC&CS,Government Code and Cipher School,Babbage, Charles Causley,Causley,Normandy,Normandy crucifix, David J Wheeler,David Wheeler,DJ Wheeler, word auto key,word autokey,WAKE,Hereward, Donald Davies,David Clayden,Codebook,Skellig,MAA,MDC,ISO 8731-2, hash,message authenticator,message digest, Message Authenticator Algorithm,timing attack,TEA Cipher, codebook,Royal Navy codebook,Jim Reeds,Naval Cipher,Naval Cypher, one-time codebook,predictive word processor,predictive word processors