Saving Face Information Tricks for Life and Love











































- Slides: 43
Saving Face: Information Tricks for Life and Love National Museum of Mathematics Math Encounters Wednesday, May 4, 2016 Tom Verhoeff Eindhoven University of Technology The Netherlands
Any-Card-Any-Number (ACAN) Trick p 1 volunteer p 27 playing cards p 1 magician p 3 questions
‘A Mathematical Theory of Communication’ p Shannon (1948): “The fundamental problem of communication is that of reproducing at one point either exactly or approximately a message selected at another point. ”
Setting for Information Theory Sender Channel Receiver Storer Memory Retriever p Problem: Communication and storage of information 1. Compression for efficient communication 2. Protection against noise for reliable communication 3. Protection against adversary for secure communication
How to Measure Information? (1) p The amount of information received depends on: n The number of possible messages n More messages possible ⇒ more information n The outcome of a dice roll versus a coin flip
How to Measure Information? (2) p The amount of information received depends on: n Probabilities of messages n Lower probability ⇒ more information
Quantitative Definition of Information p Due to Shannon (1948) p Let P(A) be the probability of answer A: n 0 ≤ P(A) ≤ 1 (probabilities lie between 0 and 1) n (probabilities sum to 1) p Amount of information (measured in bits) in answer A:
Five-Card Trick p 1 assistant p 52 playing cards p 1 magician p 5 selected cards
How Does it Work? p Use four face-up cards to encode the face-down card p Pigeonhole Principle: n 5 cards contain a pair of the same suit p One lower, the other higher (cyclicly) p Values of this pair differ at most 6 (cyclicly) p Encoding of face-down card n Suit: by suit of the rightmost face-up card n Value: by adding rank of permutation of middle 3 cards p There are 3! = 3 x 2 x 1 = 6 permutations of 3 cards
Shannon’s Source Coding Theorem (1948) Sender Encoder Channel Decoder Receiver p There is a precise limit on lossless data compression: the source entropy p Entropy H(S) of information source S: n Average amount of information per message p Modern compression algorithms get very close to that limit
Number Guessing with Lies p Also known as Ulam’s Game p Needed: one volunteer, who can lie
The Game 1. Volunteer picks a number N in the range 0 through 15 (inclusive) 2. Magician asks seven Yes–No questions 3. Volunteer answers each question, and may lie once 4. Magician then tells number N, and which answer was a lie (if any) How can the magician do this?
Question Q 1 p Is your number one of these: p 1, 3, 4, 6, 8, 10, 13, 15
Question Q 2 p Is your number one of these? p 1, 2, 5, 6, 8, 11, 12, 15
Question Q 3 p Is your number one of these? p 8, 9, 10, 11, 12, 13, 14, 15
Question Q 4 p Is your number one of these? p 1, 2, 4, 7, 9, 10, 12, 15
Question Q 5 p Is your number one of these? p 4, 5, 6, 7, 12, 13, 14, 15
Question Q 6 p Is your number one of these? p 2, 3, 6, 7, 10, 11, 14, 15
Question Q 7 p Is your number one of these? p 1, 3, 5, 7, 9, 11, 13, 15
How Does It Work? p Place the answers ai in the diagram p Yes ➔ 1, No ➔ 0 a 1 p For each circle, calculate the parity a 5 n Even number of 1’s is OK n Circle becomes red, if odd a 4 a 7 a 6 a 3 a 2 p No red circles ⇒ no lies p Answer inside all red circles and outside all black circles was a lie p Correct the lie, and calculate N = 8 a 3 + 4 a 5 + 2 a 6 + a 7
Hamming (7, 4) Error-Correcting Code p 4 data bits n To encode number from 0 to 15 (inclusive) p 3 parity bits (redundant) n To protect against at most 1 bit error p A perfect code n 8 possibilities: 7 single-bit errors + 1 without error n Needs 3 bits to encode p Invented by Richard Hamming in 1950
Shannon’s Channel Coding Theorem (1948) Sender Encoder Channel Decoder Receiver Noise p There is a precise limit on efficiency loss in a noisy channel to achieve almost-100% reliability: the effective channel capacity p Noise is anti-information p Capacity of noisy channel = 1 – Entropy of the noise p Modern error-control codes gets very close to that limit
Applications of Error-Control Codes p International Standard Book Number (ISBN) p Universal Product Code (UPC) p International Bank Account Number (IBAN)
Secure Communication p Situation and terminology p Sender ➔ Alice; Receiver ➔ Bob; Enemy ➔ Eve (eavesdropper) p Unencoded / decoded message ➔ plaintext p Encoded message ➔ ciphertext p Encode / decode ➔ encrypt / decrypt (or sign / verify) Eve Alice Enemy Bob Sender Encoder Channel Decoder Receiver Plaintext Encrypt Ciphertext Decrypt Verify Plaintext Sign
Information Security Concerns 1. Confidentiality: enemy cannot obtain information from message n E. g. also not partial information about content 2. Authenticity: enemy cannot pretend to be a legitimate sender n E. g. send a message in name of someone else 3. Integrity: enemy cannot tamper with messages on channel n E. g. replace (part of) message with other content unnoticed Enemy 1. 3. 2. Channel Enemy Channel
Kerckhoffs’ Principle (1883) p Kerckhoffs: “A cryptosystem should be secure, even if everything about the system, except the key, is public knowledge” n The security should be in the difficulty of getting the secret key p Shannon: “the enemy knows the system being used” n “one ought to design systems under the assumption that the enemy will immediately gain full familiarity with them” p No security through obscurity
One-Time Pad for Perfect Confidentiality p Sender and receiver somehow agree on uniformly random key n One key bit per plaintext bit n One-time pad contains sheets with random numbers, used once p Encode: add key bit to plaintext bit modulo 2 ➔ ciphertext bit n 0 ⊕ 0 = 0; 1 ⊕ 0 = 1; 0 ⊕ 1 = 1; 1 ⊕ 1 = 0 p Decode: add key bit to ciphertext bit modulo 2 (same as encode!) Enemy Sender Encoder Key Channel Decoder Key Receiver
One-Time Pad Is Perfect, Two-Times Not ⊕ = ⊕ =
Classical Crypto = Symmetric Crypto p Sender and receiver share a secret key Enemy Sender Encoder Key Channel Decoder Key Receiver
Security without Shared Keys: Challenge p Alice and Bob each have their own padlock-key combination n Lock A with key A n Lock B with key B p They have a strong box that can be locked with padlocks p How can Alice send a message securely to Bob? n Without also sending keys around
Shamir’s Three-Pass Protocol (1980 s) Alice Insecure channel Bob
Hybrid Crypto p Symmetric crypto is fast n But requires a shared secret key p Asymmetric crypto is slow n But does not require shared secret key p Use asymmetric crypto to share a secret key p Use symmetric crypto on the actual message p Used on the web with https p Practical hybrid crypto: Pretty Good Privacy (PGP) n Gnupg. org
Diffie and Hellman Key Exchange (1976) p First published practical public-key crypto protocol n "New directions in cryptography" n How to establish a shared secret key over an open channel n Based on modular exponentiation n Secure because discrete logarithm problem is hard p Received the 2016 ACM Turing Award
Man-in-the-Middle Attack Visualized
Secure Multiparty Computation p 2 volunteers p 5 sectors p 1 spinner
Modern Crypto Applications p Digital voting in elections, bidding in auctions n You can verify that your vote / bid was counted properly n Nobody but you knows your vote / bid p Anonymous digital cash n Can be spent only once n Cannot be traced to spender p Digital group signatures
Digital Communication Stack Sender Efficiency: Remove Redundancy Security: Increase Complexity Reliability: Add Redundancy Source Sign & Channel Encoder Encrypt Encoder Noise Channel Enemy Receiver Source Decrypt Channel Decoder & Verify Decoder
Conclusion p Information n How to quantify: information content, entropy, channel capacity p Shannon Centennial n Shannon’s Source and Channel Coding Theorems (1948) n Limits on efficient and reliable communication p Cryptography n One-Time Pad for perfect secrecy, and secret sharing n Symmetric crypto is fast, but needs shared keys n Asymmetric crypto is slow, but needs no shared keys n Hybrid crypto n Secure Multiparty Computation
Literature
Workshop p Do some of these tricks yourself
ACAN Trick
Five-Card Trick p Card suit order: p Card value order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J (11), Q (12), K (13=0) p Permutation ranking to encode distance p (You do need an accomplice!)
Ulam’s Game: Number Guessing with Lies p Questions 3, 5, 6, 7: binary search (high / low guessing) p Questions 1, 2, 4: redundant (check) questions n Chosen such that each circle contains even number of Yes