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. 


Monday, April 9, 2012

Attila the Ratcatcher

Killed 6 rats today.


Rats!
They fought the dogs and killed the cats,
And ate the cheeses out of the vats,
And licked the soup from the cooks' own ladles,
Split open the kegs of salted sprats,
Made nests inside men's Sunday hats,
And even spoiled the women's chats,
By drowning their speaking
With shrieking and squeaking
In fifty different sharps and flats.

Thursday, April 5, 2012

The Wisdom of Crowds

For the past couple of days Wikipedia on my Chrome browser has been displaying as blue and it was starting to irritate me.



So I typed "Why is wikipedia blue" in google. The top answers was below. It was asked 2 days ago and already had an answer.

Best Answer - Chosen by Asker

If you are using Chrome, it's a bug. Try making your zoom 100%. That worked for me. :)


If you are using Chrome then to see the bug you have to zoom out in the browser. Hold down the CONTROL key and rotate the mouse wheel towards yourself.

It's a good illustration of the Wisdom of Crowds.

Monday, April 2, 2012

Chateau Gaillard

I have just published my first sourceforge project. I'm quite proud of it. There's still some more rationalisation to go but it basically works.

Click here to download (for linux, windows or Mac OSX).

Just double click on the executable (cg.exe in windows, for Linux and Mac you will have to open a terminal window and just type cg_lnx or cg_osx at the prompt (haven't figured out how to do it automatically yet.

It is based on a BASIC Adventure game written for Creative Computing magazine about 30 years ago.

To download and play click on the link below. Have fun ...

https://sourceforge.net/projects/chateaugaillard/files/latest/download

The Petulant Geek has spoken.

postscript (05/04/12): It is amazing how many bugs you publish something. I found out the program does not work in Windows7 from my Dad. I bloke in India thought it needed a help command and my son found several bugs in the fighting algorithm.

Thursday, December 1, 2011

e-Tribute


I had a bit of an original thought today. Doesn't happen very often. :)

I was thinking about the ease with which a computer geek can download content from the Internet. Things like Napster, Kazaa, Pirate-Bay and the various underlying protocols which support them (bit torrent, ftp, secure http, irc). Every time the authorities close one loophole another opens up somewhere else like some collosal game of whack-a-mole.

Obi-Wan: You can't win, Darth. If you strike me down, I shall become more powerful than you could possibly imagine.

To a computer geek it is trivial to move files from place to place and more importantly to find the instructions of how the learn any new protocols which come along. This makes procuring TV shows, music, e-books (for the really intellectual geeks :-) ) fairly effortless.

Obviously, for muggles this is not so straightforward. They do not have the technical ability to do this which means either relying on a geek or using a service like iTunes or Amazon to get their content.

It suddenly occurred to me that this is a form of wealth. It's wealth in the sense that it requires less effort (think how much a competent plumber would save on labour charges (+ VAT) to fix the heating system in his own house).

It then occurred to me that what is referred to as Internet Piracy could be thought of as tribute to the technically competent from the technically challenged.

Some time ago, I was reading an article about Paul Wolfowitz. He used to be head of the World Bank and I discovered that he basically paid NO TAX on his income. I remember remarking at the time. "How does he get away with that then. What a scam ! What an outrage !".

Based on the insight above I realised what it probably really meant. I thought, hang on, that sounds a bit like the Romans. The World Bank are the Romans. They don't pay tax because they are in charge. Render unto Wolfowitz, that which is Wolfowitz'. Of course its no longer Wolfowitz, its looks like its this guy now.

So perhaps the geeks will inherit the earth after all.   :-)