Monday, May 19, 2014

The Best Laid Schemes of Mice and Straw Men

The first, of gold, who this inscription bears:
“Who chooseth me shall gain what many men desire.”
The second, silver, which this promise carries:
“Who chooseth me shall get as much as he deserves.”
This third, dull lead, with warning all as blunt:
“Who chooseth me must give and hazard all he hath.”
How shall I know if I do choose the right?
- Shakespeare - The Merchant of Venice

In this post-911 epoch of suspicion and fear the subject of searching people seems to be on the agenda almost constantly.  Do the authorities have a right to search you ?  Do they have a right to force you to reveal a password allowing them to reveal the contents of your mobile phone, or is it none of their business.

I have thought of a very elegant solution to this problem but first I need to introduce you to some simple stuff about encryption (please skip if you are already a tech geek).

Simple Analogy

Imagine if you wanted to prevent somebody from gaining access to a personal belonging of yours (e.g. a gold necklace).  One way of acheiving this would be to place it in a combination safe.  There are only two ways that a criminal can now obtain the gold bracelet.

1. By procuring the combination (by violent means if necessary)
2. By forcing open the safe (using say, explosives or a welding torch)

There is a kind of encryption known as Public/Private key encryption which can hide a file in a similar way, however, in order to explain it we need to modify the above analogy in the following way.

Moderate Analogy

Now imagine a combination safe with 2 doors, with a combination on each door.  Lets call them Door A and Door B.

Door A allows one to place objects in the safe.  Door B allows one to retrieve objects from the safe (note: using the simple analogy above the combinations for Door A and Door B would be the same).

If one opens Door A and places and object in the safe, closes door A, and then re-opens Door A the object will no longer be present.   Another way of thinking of Door A is as not really a door at all, more like an aperture/slot (e.g. in a post box).  The combination allows one to open the slot and put a parcel in.

If one opens Door B one can retrieve whichever item has been added via door/slot A.  However, one cannot put an object into the safe using door B.  Door B is a little like the receptacle on a confectionary machine.

In order to transfer the above analogy above to the computer/virtual realm we need to add the following caveats.
  • Door/Slot A can only be used to add an item/information into the safe/container.
  • Door/Receptacle B can only be used to retrieve an item from the safe/container.
  • When an item/information is retrieved from the safe/container it is a copy that is retrieved
  • The only method to destroy the item/information permanently is to destroy the safe/container.
  • Another term for Door A is the Public Key
  • Another term for Door B is Private Key
( Geeks can start reading again now :-)  )

Now imagine that this (virtual) safe holds personal information stored on one's mobile phone using public/private encyption (see moderate analogy above).  If the authorities want to see the information on one's mobile phone (and they have the right to do so) they will simply force you to reveal the PRIVATE password (i.e. the combination to Door B).  However, this is where the final COMPLEX analogy comes in handy.

Complex Analogy

And so,” said the Cat in the Hat, “So so so...
I will show you Another good game that I know!”
And then he ran out. And then, fast as a fox,
The Cat in the Hat Came back in with a box.
A big red wood box. It was shut with a hook.
“Now look at this trick,” Said the cat. “Take a look!”
Then he got up on top With a tip of his hat.
“I call this game FUN IN A BOX,” said the cat.
- Dr Suess, The Cat in the Hat

This new safe has 2 doors like the Moderate safe.  An Input door/aperture/public and an output door/receptacle/private. However, unlike the moderate safe this one has 6 combinations. 3 of the combinations can be used to open the input door/aperture and 3 can be used to open the output door/receptacle.

Lets call the input combinations IK1, IK2 and IK3 and the output combinations OK1, OK2 and OK3.

When one deposits an item/information in the input aperture using key IK1 it can only retrieved via the output receptacle using key OK1.

When one deposits an item/information in the input aperture using key IK2 it can only retrieved via the output receptacle using key OK2.

When one deposits an item/information in the input aperture using key IK3 it can only retrieved via the output receptacle using key OK3.

Now transferring the analogy above to one's mobile phone. If the bad guys/authorities want to retrieve the information stored on ones mobile phone then they effectively have to have access to all the output combinations which the (analogical) safe contains. When one is asked to reveal the combination one can simply hand over one of the combinations which hold a different item.

The key thing to remember here is that the authorities don't know how many multiple keys the safe has so even if they procure a private key this will not help them particularly if the information which they reveal is plausible.

It is a kind of straw man defence strategy.

The safe with multiple locks could in theory have N inputs and N outputs allowing any number of alternative objects for the authorities to recover.

The Petulant geek has spoken.

Saturday, May 17, 2014

Got a good idea ? perhaps you need to sleep on it

I once had a strange dream that my wife was a floating point number.  I had been working quite intensively on a radar display to perform calculations using exponents+mantissas.

It seems somebody has found a precedent for my former madness.

http://www.scientificamerican.com/article/tetris-dreams/

and now for a musical interlude


The Petulant Geek has spoken.

Friday, May 16, 2014

Regular verbs

I was reading something on a blog today which I found intriguing.

http://besslerwheel.com/forum/viewtopic.php?p=123324&highlight=#123324

A non english speaking person had posted a blog entry and used the phrase "I'm waiting sited".  Several english speaking members of the forum had not understood this phrase.  I guess they thought he he meant the word sited (the position or location of a town, building, etc.) but what he in fact meant was "I'm sat waiting".

When he finally clarified the the reason for his mistake it boiled down to the assumption that the verb 'to sit' (sitting) was a regular verb (e.g. play/played happen/happened) and not an irregular verb (e.g. sit/sat run/ran).

The thing is, I was confused by the explanation too since I did not know immediately what he meant by regular and irregular verbs (i.e. I had to look it up).  I always associate the use of terms like regular, irregular, past tense, present tense with the study of french when I was a school.  Obviously however they are just as applicable to one native language (English) as other languages.

I think the reason for this may be because one learns ones native language by osmosis and trial and error.  I did not learn english by applying grammatical rules to prose (as a machine would) but by trial and error.  If a 5 year old child said 'sited' instead of 'sat' they would likely receive a gentle rebuke from a peer like "not sited, sat silly !".

Is this scientific approach towards language the best approach ?  In my experience it is not.  Here's are some observations to support my theory.

I used to play snooker and table tennis sufficiently often to get a fairly good standard.  I found that to get to the stage where you were any good you effectively had to just train yourself how to hit certain shots.

I joined a table-tennis club and the teacher showed me how to return smashes.  Essentially, it boils down to simply putting one's racket directly in the line of attack of the ball and then angling one's bat so that the return path of the ball hits the oppenents end of the table.  It is a little like reflecting the light from the sun into a certain spot using a mirror or concentrating the sun's energy onto a certain point using a magnifying glass to generate heat.  The main point is that you just learn how to do it by NOT returning a sufficient number of smashes.  One learns by ones mistakes.  Once one is proficient at returning smashes it almost feels as if the mathematical/scientific rules aspect are burned into ones brain a little like installing a program into a computer.

I noticed a similar feeling when playing snooker shots.  When one is trying to calculate the glancing angle between the cue ball and the object ball in order to correctly hit the pocket it just becomes instinctive after a while.  Once one has learned how to play if one trys to calculated the angle manually you will more often than not MISS.

I also taught myself to touch type but I cannot quickly tell you the position of the keys although I must know where they are since I am able to type quickly without looking at the keys.

I think the same applies to the written word.  I think authors/poets use language in a similar way to how one drives a car, touch types, returns a smash.  It's a kind of self taught instinct.

A now a few words from a master...

I wandered lonely as a cloud
That floats on high o'er vales and hills,
When all at once I saw a crowd,
A host, of golden daffodils;
Beside the lake, beneath the trees,
Fluttering and dancing in the breeze.

Continuous as the stars that shine
And twinkle on the milky way,
They stretched in never-ending line
Along the margin of a bay:
Ten thousand saw I at a glance,
Tossing their heads in sprightly dance.

The waves beside them danced; but they
Out-did the sparkling waves in glee:
A poet could not but be gay,
In such a jocund company:
I gazed--and gazed--but little thought
What wealth the show to me had brought:

For oft, when on my couch I lie
In vacant or in pensive mood,
They flash upon that inward eye
Which is the bliss of solitude;
And then my heart with pleasure fills,
And dances with the daffodils.