4
$\begingroup$

Is there a cryptographic hash function that well suited for preschool-aged children to work out on pencil and paper, to learn concepts of block chains?

It must have the following requirements:

  1. Able to be easily verified
  2. Able to be easily calculated with pencil and paper
  3. Able to link to previous result, to create blockchain

The function may be low-complexity. It does not matter if the function is easily broken.

$\endgroup$
  • 1
    $\begingroup$ Can you provide some further context? Without more context, this question is pretty broad and hard to answer well. $\endgroup$ – thesecretmaster Mar 7 '18 at 2:58
  • 4
    $\begingroup$ I have a 4 year old and this seems rather ambitious, but I commend the effort! $\endgroup$ – Jed Schneider Mar 7 '18 at 3:09
  • 5
    $\begingroup$ Pre-school meaning that they're just learning to hand-write letters, and can't reliably read words? $\endgroup$ – Ben I. Mar 7 '18 at 9:33
  • 1
    $\begingroup$ I recommend the following textbook: amazon.ca/Peek-Boo-Friends-Parragon-Books/dp/1472305922 While not explicitly a text on cryptographic hash functions, it can demonstrate the concept of a blockchain to preschoolers. Each page has a window back to the previous page, and forward to the next page, these windows allow verification that the current page indeed follows the previous, allowing the student an early appreciation for blockchain suitable for a preschooler. $\endgroup$ – Gorchestopher H Mar 7 '18 at 19:04
  • 2
    $\begingroup$ I don't thing that hashing and block chains are the same thing, however block chains will use hashes. $\endgroup$ – ctrl-alt-delor Mar 7 '18 at 19:12
4
$\begingroup$

If all you want is a simple hash function you could do something like this. First take your original message and apply something like ROT 13 to it. This gives a reversible cipher, of course. Then give each letter a number, say N = 1, O = 2, etc, wrapping after Z. Next, just add up all of those values. It is no longer a reversible cipher, but a hash. To get it to be fixed length, simply pad or truncate it to, say, five digits.

Pretty bad cryptography, of course, but simple enough if the students can count and add.

The use in a blockchain is up to you.

This hash has the features described here: https://en.wikipedia.org/wiki/Cryptographic_hash_function, but they aren't very strong, of course.

Fixed Length
Deterministic
Easy to Compute
Infeasible to Reverse
Change in the Message changes the Hash (not a lot, though)
Infeasible to Generate a false message with the same Hash (maybe).

Call it the puppy-1 hash function if you like.

And of course ROT-13, like the Caesar Cipher, has some historical interest.


In the first part, ignore case, punctuation, spaces, etc., which isn't sufficient in general, but should be for this use.

$\endgroup$
  • $\begingroup$ I'm not sure that addition is a reasonable assumption for the pre-school set, though this would be great in middle or upper elementary school! $\endgroup$ – Ben I. Mar 8 '18 at 11:10
  • $\begingroup$ ROT13 popped into my head when I read the question. $\endgroup$ – Guy Coder Mar 8 '18 at 19:00
2
$\begingroup$

A simple hash algorithm is modulo or remainder (they are the same for positive numbers). You only need be able to count.

To calculate $n$ modulo $m$, take $m$ empty pots, and $n$ marbles. Place one marble in front of each pot, then put the marbles in the pots, and repeat until you do not have enough marble for each pot, count the marbles that are in-front of the pots (that is the answer).

In is not a cryptographic hash, but it is a hash. I doubt that you will be able to do a crypto hash at this age.

Another algorithm, would be horizontal and vertical parity. (not very hashy, but related) see CS unplugged. https://www.youtube.com/watch?time_continue=210&v=FnwBratAhfg and https://csunplugged.org/en/topics/error-detection-and-correction/

$\endgroup$
1
$\begingroup$

Pick your first word from the sentence to hash. Look it up in a dictionary and write down the first word of the description. Pick the next word and look it up. Write down the second word from the description. Do this repeatedly and wrapping around from start to finish of the description as many times as necessary depending on the position of the word.

A weak hash function for text.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.