Last week I was asked to explain the concept of a single-digit checksum to help secure and validate a set of chemical values. That was an interesting challenge as some get it first time, some find it confusing.

After explaining the concept and finding it to be interesting, I thought I’d start my week by providing a simple guide and then point out a flaw and ask you, the reader of the article how you might solve it. So, after you’ve read this, I’d love to hear how you’d tackle the flaw that I leave you with. If this is a new subject for you, don’t worry, I’ve kept it short and simple.

Let’s work this through using a scenario to build the picture and give it some context.

Scientist A (Anna) needs to send a series of ten three-digit values to Scientist B (Barry) so that he can configure his equipment. The accuracy of the settings is important, and Anna doesn’t want the figure to get confused in transmission. Barry, therefore, needs to check that he has the correct values. Anna decides to send the ten three-digit values and a single value, the thirty-first digit, as a checksum. To start, Anna sends the following sequence of ten three-digit numbers so Barry can start his trial.

456789159432887612357448965481

Now Anna needs a single digit checksum to help Barry validate that the number is correct. Anna starts by adding up the ten values,

456+789+159+432+887+612+357+448+965+481 = 5586

Now Anna has the total which equals 5586. She needs a single-digit checksum, so she then adds the four digits in her answer,

5+5+8+6 = 24

Anna still has a two-digit number and so she needs to add them together again,

2+4 = 6

And now Anna has her checksum. 6 and her final 31-digit transmission would look like,

4567891594328876123574489654816

By following the logic above, Barry is able to take the first thirty digits and then validate them against the thirty-first. If it all checks out, then the data validity is maintained, and his numbers are secure.

A checksum is a great way of validating that any sequence of values maintains its integrity. In this instance, Barry is able to configure his equipment and run his experiment.

Now, to the flaw I warned you would exist in the logic.

The sequence of numbers can also be key. If the number order was changed, the totals would still be right, and the checksum would still add up. Barry would be none the wiser and his experiment would fail.

The question I have is, how could you also protect the integrity of the number order?