Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds 2.75 hours.

29
odebreaking in Everyday Li debreaking in Everyday Lif John D John D Barrow Barrow

Transcript of Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds 2.75 hours.

Page 1: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Codebreaking in Everyday LifeCodebreaking in Everyday Life

John D John D BarrowBarrow

Page 2: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.
Page 3: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

10 x 10 x 10 x 10 seconds 10 x 10 x 10 x 10 seconds 2.75 hours2.75 hours

Page 4: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.
Page 5: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Trap-door OperationsTrap-door Operations

QUICK to encode

SLOWto break

Big prime number x Big prime number = very large composite number

Page 6: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.
Page 8: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Are there enough Postcodes to Are there enough Postcodes to go round?go round?

The Pattern is AB3 4CD262610102626 = 45,697,60045,697,600 choices

UK population approximately 60,587,000Approximately 26,222,00026,222,000 households

and 28,500,50028,500,500 expected by 2020

Enough for houses But not for people!

Page 9: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

National Insurance NumbersNational Insurance Numbers(are not boring)(are not boring)

Eg pattern is NA123456XEg pattern is NA123456X 2626262610101010101010101010101026 = 26 =

17.576 billion17.576 billion Population of the world is about 6.65 billion Population of the world is about 6.65 billion

and maybe 9 billion by 2050and maybe 9 billion by 2050

Page 10: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Stanley Milgram’s (Other) Stanley Milgram’s (Other) Experiment (1967)Experiment (1967)

Give many letters addressed to a Boston stockbroker Give many letters addressed to a Boston stockbroker to random people in Omaha, Nebraska and Wichita, to random people in Omaha, Nebraska and Wichita, Kansas with a profile of stockbrokerKansas with a profile of stockbroker

They were to send them on to an acquaintance who They were to send them on to an acquaintance who they felt might know more about the stockbroker, they felt might know more about the stockbroker, sign a roster and post a card (less junk mail in those sign a roster and post a card (less junk mail in those days!)days!)

About 20% of Milgram’s letters reached the About 20% of Milgram’s letters reached the stockbrokerstockbroker

On average they took 6 reposting ‘steps’ to get there On average they took 6 reposting ‘steps’ to get there via the social network of friends (6.6)via the social network of friends (6.6)

Page 11: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Small-World NetworksSmall-World Networks

If you know 100 people and they know 100 others then you are justone step away from 10,000 peopleN steps away from 102(N+1) peopleWorld population is 6.65 billion = 109.8

2(N+1) > 9.8 when N exceeds 4

Page 12: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

“Six Degrees of Separation”

Page 13: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Friends of Friends of Friends Friends of Friends of Friends Are ImportantAre Important

Close links (friends and family) are a Close links (friends and family) are a lot like you and know the sorts of lot like you and know the sorts of things and people you know. things and people you know.

More distant acquaintances are more More distant acquaintances are more likely to know things and people that likely to know things and people that you do not. you do not.

The Prince and the pauperThe Prince and the pauper

Page 14: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Average Path LengthAverage Path Length ErdErdöös number of mathematicianss number of mathematicians

It’s a Small World After AllIt’s a Small World After All Average Dist = (ln N / ln K) = 5.9 Average Dist = (ln N / ln K) = 5.9

where N = total nodes and K = friends per node. where N = total nodes and K = friends per node. And K=30 and N = 10And K=30 and N = 108.88.8 = 10% = 10% world population world population

Page 15: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Problems With NamesProblems With NamesThe Soundex Phonetic System (1918)The Soundex Phonetic System (1918)

Keep first letter of the nameKeep first letter of the name Delete a,e,i,o,u,h,y,wDelete a,e,i,o,u,h,y,w Assign numbers to the rest of the lettersAssign numbers to the rest of the letters b,f,p,v = 1b,f,p,v = 1 c,g,j,k,q,s,x,z = 2c,g,j,k,q,s,x,z = 2 d,t = 3 and l = 4 d,t = 3 and l = 4 m,n = 5 and r = 6m,n = 5 and r = 6 If two or more letters with same number are adjacent in If two or more letters with same number are adjacent in

original name keep only the firstoriginal name keep only the first Keep only first 4 characters, make up to four with 00s if Keep only first 4 characters, make up to four with 00s if

neededneeded John Barrow John Barrow Jn Br Jn Br J5 B6 J5 B6 J500 B600 J500 B600 Smith and Smyth Smith and Smyth S530 S530 Ericson, Erickson, Eriksen, Erikson Ericson, Erickson, Eriksen, Erikson E6225 E6225. Robert, Rupert . Robert, Rupert

R163R163

Page 16: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Check-Digit CodesCheck-Digit Codes To guard against transcription errorsTo guard against transcription errors Catch naïve fraudstersCatch naïve fraudsters Credit cards, tickets, passports, tax ID nosCredit cards, tickets, passports, tax ID nos 889/899, 1112/112, 43/34,…..889/899, 1112/112, 43/34,….. Internal self-checking system to validate Internal self-checking system to validate

numbersnumbers Airline tickets 10 digits + one check digit Airline tickets 10 digits + one check digit

which is remainder after dividing by 7which is remainder after dividing by 7 4851913640 = 693130521 x 7 + 34851913640 = 693130521 x 7 + 3 So ticket no. is 4851913640 3 So ticket no. is 4851913640 3

Page 17: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Simple Errors Can Cause ProblemsSimple Errors Can Cause Problems

TypeType Approx FrequencyApprox Frequency

a by b 79% ab by ba 10% abc by cba 1% aa by bb 0.5% a0 by 1a (a=2,3,..) 0.5% aca by bcb 0.3%

Page 18: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Banking – What’s It All About?Banking – What’s It All About?

Page 19: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

IBANsIBANsInternational Bank Account NumbersInternational Bank Account Numbers

GBGB8282 WEST WEST 1234 561234 5698 7654 3298 7654 32Country - Country - cheque nocheque no - bank - - bank - sortsort – account no. – account no.

1. Move first 4 characters to the end2. Replace letters by A=10, B=11,…Z=353. Interpret digit string as a decimal4. Divide by 975. Valid IBANS give a remainder = 1.eg WEST 1234 5698 7654 32 GB82 3214282912345698765432161182 = 1 mod 97 This is a valid IBANThis is a valid IBAN

MovedMovedfrom frontfrom front

Page 20: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Credit Cards and the Luhn Credit Cards and the Luhn TestTest

12 or 16 digits, for example:12 or 16 digits, for example:4000 1234 5678 93144000 1234 5678 9314

L to R, double the digits in odd slots, add the two L to R, double the digits in odd slots, add the two if bigger than 9 (14 if bigger than 9 (14 5 etc) 5 etc)

8 0 2 6 10 14 18 28 0 2 6 10 14 18 2 8 0 2 6 1 5 9 28 0 2 6 1 5 9 2

Sum = 33 + original digits in even slotsSum = 33 + original digits in even slots8+2+6+1+5+9+2+8+2+6+1+5+9+2+0+0+2+4+6+8+3+40+0+2+4+6+8+3+4 = = 6060The total must be divisible by 10 for a valid card The total must be divisible by 10 for a valid card

Card number Card number 4000 1234 5678 9010 4000 1234 5678 9010 fails (sum = 57)fails (sum = 57)Catches all single digit errors, most adjacent swopsCatches all single digit errors, most adjacent swops

(not 09/90 though)(not 09/90 though)Invented by Peter Luhn at IBM in 1954Invented by Peter Luhn at IBM in 1954

Page 21: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Need to change the final check digit from 3 to 8 to validate the numberThis is a necessary, but not a sufficient, condition for the card to be valid!

Fails !

Check validityCheck validity

Page 22: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Universal Product CodeUniversal Product Code• Began in 1973 for grocery products now used for most retailed goods

• 12 digit number represented by bars for laser scanning

•Two strings of five between two single digits

Type of productType of product manufacturermanufacturer size/colour/modelsize/colour/model check check digitdigit

6 6 4420944209 42095 42095 77

0,1,6,7,9 = any 4 = sale items2 = food by weight 5 = special offers/coupons3 = drugs, health

Page 23: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

3 3 474370474370 01631 01631 77

Check digit ?Check digit ?

Add digits in odd positions: 3 + 7 + 3 + 0 + 1 + 3 = 17

Multiply by 3: 3 17 = 51

Add digits in even positions: 51 + 4 + 4 +7 + 0 + 6 +1 = 73

Divide by 10: check digit is 10 minus the remainder = 7= 7

Page 24: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

ISBN-10ISBN-10Multiply each digit by its position from the right. Add and check digit mustmake the sum divisible by 11. If the remainder is 10 use Xeg for 0-19-280569-X the sum is 199 + X. If X is 10 the total is 209 = 19 11

ISBN-13ISBN-13

Is like UPC but multiplies even digits by 3 instead of odd ones. Check digitmust make sum divisible by 10.

Page 25: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

International Mobile Equipment International Mobile Equipment Identity IMEIIdentity IMEI

This is what you cancel This is what you cancel when your phone is stolenwhen your phone is stolen

Changing it is a criminal Changing it is a criminal offenceoffence

14 digits + check digit14 digits + check digit The software version The software version

IMEISV has 16 digitsIMEISV has 16 digits

Page 26: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

490154203237549015420323751?1?

IMEIIMEI 44 99 00 11 55 44 22 00 33 22 33 77 55 11 ??

DoublDoublee

EveryEvery

OtherOther

44 1818

= = 99

00 22 55 88 22 00 33 44 33 1144

==

55

55 22

SuSumm

44 99 00 22 55 88 22 00 33 44 33 55 55 22 5252

++

??

CalculateCalculatecheckcheckdigitdigit

Page 27: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

IMEI is IMEI is 490154203237518490154203237518

IMEIIMEI 44 99 00 11 55 44 22 00 33 22 33 77 55 11 ??DoublDoublee

EveryEvery

OtherOther

44 1818

99

00 22 55 88 22 00 33 44 33 1144

55

55 22

SuSumm

44 99 00 22 55 88 22 00 33 44 33 55 55 22 52+52+

88

Sum must be divisible by 10Sum must be divisible by 10

CheckCheckDigitDigitAddedAdded

Page 28: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

The General PictureThe General Picture Check digits are computed from a product codeCheck digits are computed from a product code

aa11aa22aa33aa44…..a…..ann byby multiplying by weights multiplying by weights ww11ww22ww33ww44…..w…..wnn and evaluating the dot product and and evaluating the dot product and remainder on dividing by remainder on dividing by rr

C =C = r -r - (a(a1 1 ,a,a2 2 ,a,a3 3 ,…a,…ann))((ww11,w,w22,w,w3 3 ,…w,…wnn) = r - ) = r - aaww (mod r)(mod r)

UPC : n = 12, UPC : n = 12, ww = (3,1,3,1…), r= 10 = (3,1,3,1…), r= 10 EAN-8: n = 7, EAN-8: n = 7, ww = (3,1,3,1…), r= 10 = (3,1,3,1…), r= 10 Airline: n = 10, Airline: n = 10, ww = (1,1,1,1…), r= 7 = (1,1,1,1…), r= 7 ISBN-10: n = 9, ISBN-10: n = 9, ww = (10,9,8,7…,2,1), r= 11 and X =10 = (10,9,8,7…,2,1), r= 11 and X =10 ISBN-13 and EAN-13: n = 12, ISBN-13 and EAN-13: n = 12, ww = (1,3,1,3…), r = 10 = (1,3,1,3…), r = 10

Page 29: Codebreaking in Everyday Life John D Barrow. 10 x 10 x 10 x 10 seconds  2.75 hours.

Sometimes You Don’t Need Numbers