Click to see full photo

Keith Lockstone's home page

Cryptographic material

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.

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.

Authentication for Radio Amateurs:  The rules of Amateur Radio forbid the hiding of messages i.e. encryption.  However, modern encryption technology makes Authentication possible without encryption.  This can be useful where there is a need to control remote devices such as repeaters and beacons that sometimes suffer from electronic vandalism.

In the May issue of RADCOM, the monthly magazine of the Radio Society of Great Britain (RSGB), I had published an article titled 'Using Authentication in Amateur Radio'.  (Copyright © RSGB 2016,, all rights reserved.  Used here with permission)   It's of interest that the message dialogue is held together by a Block Chain.

Caveat Encryptor

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

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.

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

Amateur Radio


Due to the pandemic, OFCOM have relaxed the rules for special event stations so that Radio Amateurs can transmit remotely from the event site.

This year from my home in Pevensey Bay I'm activating the special event call sign of GB0SCW for Stone Cross Windmill.   GB0SCW will be active from 10:00hrs until 19:00hrs on the 8th & 9th May 2021.  Bands: 3.5, 7, 28, 50, 144 MHz.

The windmill is a fully working windmill and is located just outside of Eastbourne at Stone Cross, East Sussex, United Kingdom. The mill was built in 1875 and is of a static tower design with a rotating cap driven automatically to place the sails into the wind using a fan tail.  The ground floor contains a museum of historic models of mills and various associated windmill tools and parts. More can be found out about this at:

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.

Don't Trust Your Data

How a simple PHP utility designed to display web logs turned into a security threat.  Javascript injected into web logs can cause a potential security breach.




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

© 2021  Keith Lockstone

Comments to:  Keith

This page has been visited     times.