CS195Y Lecture 1

January 27, 2016


What is logic? What do you use logic for?
What is a system? How do they relate?
How do you know if a system works?

Riddle 1
Alice -> Bob -> Charlie
Brown Not Brown
Does someone who graduated from Brown directly supervise someone who did not graduate from Brown?
Yes, Alice supervises Bob and she graduated from Brown while he did not.

Alice -> Bob -> Charlie
Brown Not Brown
Now does someone who graduated from Brown directly supervise someone who did not graduate from Brown?
Yes. If Bob did not go to Brown, then he is supervised by Alice who did. If Bob did go to Brown, then he supervises Charlie who did not.

Riddle 2
There are two rooms separated by a wall. Prisoners can only see the people in front of them.
They know there are two red hats and two blue hats. If any of the prisoners can figure out what
color hat they are wearing, they all go free.

/r\ | /b\ /r\ /b\   
 O  |  O   O   O 
________________

Can anyone figure out what color hat they are wearing?
The gnomes are smart, logical, and trust each other. There is no time limit.
Answer: The middle gnome hears the back gnome say 'I don't know.' The middle gnome now knows that its hat is a different color than the gnome in front of it, because if they were the same color, the back gnome would have been able to figure out its own hat color. So, in this case, the middle gnome
correctly figures out that its hat is red.

Public Key Cryptography
Messages are encrypted with public key (which everyone has access to), but can only be decrypted with private key.

  Alice                       Bob
   ----- {Alice, SecretA}B ---->
   <---- {SecretA, SecretB}A ---
   ----- {SecretB}B ----------->

This was widely used and proven correct. Can you find the vulnerability in this interaction?
The protocol works as expected when the two parties are trustworthy, but consider what happens when one party is not trustworthy

Tim                           Eve                     Tim's Bank
  ---- {Tim, SecretT}E ------->
                                ---- {Tim, SecretT}B ------>
                                <--- {SecretT, SecretB}T ---
  <--- {SecretT, SecretB}T ----
  ---- {SecretB}E ------------>
                                ---- {SecretB}B ----------->

Now, Tim thinks he's just talking to Eve, but Tim's Bank thinks they're talking to Tim.
Can it be fixed?
In the third line, send {SecretT, SecretB, Bank}T, so that when it gets to Tim, he realizes that Eve was trying to talk to his bank, and he can safely stop the interaction.