Presentation on theme: "Electronic Cash and User Authentication using the Dallas Semiconductor / Maxim DS1963S Monetary iButton."— Presentation transcript:
1 Electronic Cash and User Authentication using the Dallas Semiconductor / Maxim DS1963S Monetary iButton
2 e-Cash - “Electronic Money” The DS1963S eCash iButtonWho I Am:Hardware and Software EngineerA student of cryptographyWrote crypto iButton comm layersWarnings:WE WILL COVER MANY THINGS YOU MAY ALREADYKNOW VERY WELL.This session is intended to give a ageneral understanding of the DS1963S and the methods we use to secure money and data in it.
3 An ApologyThis presentation was intended for “interested lay-persons”. Apologies in advance for it’s extreme simplicity. It was also intended to make sense without the accompanying lecturer, to please excuse the detail (and length) of the presentation.
4 What We Will Discuss How money and credit are handled now Why e-Cash is betterThe Evolution of a Secure eCash iButtonThe DS1963S Monetary iButton (MiB)Why Security is ImportantHow the DS1963S features provide security
5 We’ll Also Touch On... iButtons in General iButton Physical Security IssuesVarious kinds of CryptographyAttacks against e-Cash SchemesVarious e-Cash Applications
6 Be Sure You Understand!These slides indicate places where you should make sure that you are keeping upIf you missed something, SPEAK UP!These slides will remind youExplain how these will occur to spark people to speak up if they are not following.
7 What is “Cash Money” ? A representation of value Recognized and validated by look, feel, familiarityValue is represented physically (ink on paper)Can be stolen by anyone with a physical advantageHas no value in and of itself.Just paper and ink!Value is in the backing - the govornment backs it.As long as we all agree that money has value, it works!
8 What’s Good About Cash?Anonymous - The seller doesn’t care who you areDifficult to counterfeit (paper, printing methods, lots of new tricks)Backed by the governmentTrusted by everyone (We’re all used to it…)A visible representation of funds (you can see what you’ve got)Is it really difficult to counterfeit?
9 What’s New About Your Cash SerialNumbersFine LinePrintingPortraitWatermarkAlso:Ink is magneticRear includes oversized letters to be easier to readSecurityThreadMicro-printingColor ShiftingInk
10 What’s Bad About Cash?Must be handled/observed by human eyesight or costly photo-scannerFixed denominations - requires making changeNot suitable for use on the InternetBills consume space, must be physically securedNo audit trail
11 What’s REALLY Bad About Cash? Carrier is in physical danger of being robbed of cashStolen cash may be freely usedPaper bills spread germs and disease
12 A Warning!“It is highly likely that an epidemic of global proportions - a serious threat to all human life - will be spread around the world quickly and efficiently on paper currency.” - From a joint statement by the World Health Organization and the United States Centers for Disease Control in 1994.
13 What is a Credit Card? A representation of your responsibility Really just an ID cardBacked by you - the individualRecognized and validated by look, feel, familiarity
14 What’s Good About Credit Cards? Somewhat difficult to duplicate (embossed plastic, magnetic stripe data, holograms)No denomination - No need to make changeAudit trail is owned by the card issuer and the userSlightly more easily used over the Internet (only because number can be used w/o plastic card)
15 What’s Bad About Credit Cards? Not anonymous. Depends on knowing exactly who you areData stored magnetically, costly mechanical readerAudit trail owned by the card issuer and who else?No easy visual representation of funds
16 What’s REALLY Bad about Credit Cards Account number alone can be used if it is stolen or discovered (card is not required)No PIN or Password required in most cases, allows anyone with the number to use itEvery vendor must be connected to the central server (via phone or network)Vendor-end equipment is costly
17 i Why eCash is Like Cash? A representation of value Anonymous - The seller doesn’t care who you arei
18 Why is eCash like a Credit Card? No denomination - No need to make changeInformation is electronic, access is simple and fastAudit trail is optional and personali
19 Why is eCash Better than Cash or Credit Cards? Perfectly suited for computers, the InternetValidated using advanced cryptography (much more secure)Almost impossible to counterfeitCarrier is not in physical danger of robberyIt’s easier to obtain a visual, private representation of your funds
20 Why Not e-Credit Cards? Credit Cards require database lookups Database lookups take timeDatabase currency is a problemAll vendors must have a telephone or network connection to access databaseNot all recipients are connected or even “connectable” to the bankVending equipment is too expensive
21 The Dallas Semiconductor iButton as an Electronic Token for e-Cash Applications
22 What is an iButton? Portable memory that doesn’t forget Electronic circuits that can control or limit data accessIt can keep secretsPhysically secure circuit assemblyPhysically secure steel containerROM IDCONTRLRAMBattery
23 Non-Volatile Memory Random Access Memory (RAM) Data is sustained by internal batterySpecial mechanisms to assure good data despite intermittent connectionsMemory organization using TMEX allows easy, efficient sharing of the memory area between users
24 Very Simple Connection Communicates 2-ways using one signal lineMuch simpler than radio, magnetic, or infra-red communicationsVery simple and inexpensive connection to electronic systemsA variety of ways to get into computers (serial ports, parallel ports, USB ports, etc..)
25 Just a Touch...Communicating with an iButton requires a simple touch of the iButton to a readerPositive action by the user is requiredThere is no doubt about the intent, no accidental communications take place
26 The Most Important Feature A unique Serial Number, sometimes called a “ROM ID”A permanent identifier that cannot be re-programmedNo two iButtons EVER have the same serial numberROM IDCONTRLRAMBattery
27 An iButton Serial Number D6 0CErrorCheckCodeUnique Serial NumberFamilyCodeShown in Hexadecimal notation
28 Facts about iButton Serial Numbers Written by a laser when iButton is manufacturedEvery iButton is unique. No two iButtons will ever have the same serial numberThe biggest iButton serial number possible is 281,474,977,000,000 iButtons in each familyThere can be 256 families, for a total of 18,010,000,000,000,000 iButtons in all!We will NEVER run out of numbers
29 iButtons with Special Functions Temperature SensorsTime/Temperature HistogramsTime clocks (DS1994)Password-protected memories (DS1991)Analog-to-Digital Converters
30 Be Sure You Understand!Do you know all about iButtons and their basic features?Do you know how iButtons are carried and used in day to day applications?Understand the Unique Serial Number?
31 Evolving eCash...We will walk through the evolution of an eCash iButton, starting at the simplest form, examining ways that it could be attacked, and then adding methods to protect against attacks, until we achieve a sound eCash solution.
32 How We Can Put Money Into an iButton Money is just a number (call it your “balance”)The bank takes cash, writes money amount into your iButton memorySeller reads the balance, subtracts the amount of the sale, writes the new balance back into the iButton$123.45i
33 Think of it as MoneyThe iButton contains a balance stored in the RAM by a monetary authority (like a bank)The balance represents your money remaining; the funds that are left in your iButton “account”
35 Let’s Make Ourselves Rich! It’s EASY to change the numbers in RAMWe’ll just raise the balance amount to whatever we wantInstant money!Who will know?
36 Why is it So Easy to Cheat? Access to the iButton data is very easy (our own data books tell you how)The Bad Guy just writes in a bigger balanceThere’s no protection against anyone altering the memory contentsThere’s no easy way to detect that the fraud has been perpetrated
37 A Memory iButton Alone is Not Enough for Secure eCash The Evolution of aBetter e-Cash iButton
38 To Make a Better eCash Token, We’ll Need Some Help... Special Hardware Features and FunctionsSpecial Secure Assembly MethodsStrong Cryptographic TechniquesCareful Analysis of All Possible Attacks
39 Introducing Cryptography From simple substitution ciphers to highly advanced mathematical algorithmsCryptography is a science all its own!It has its own language, symbols, and lingoMessageCryptogramCIPHERPlaintextCiphertext
41 “Message”Simple enough: Your “message” is whatever you have that you wish to protect or hide from all but the intended recipient.
42 Plaintext, Ciphertext Plaintext is the message that you wish to send It is clearly read and understood by anyoneIt is insecureCiphertext is the encrypted messageIt makes no sense to anyone when they attempt to read itIt is secure because the real contents cannot be read or understood
43 “Cryptogram”A Cryptogram is a Message that has been encrypted, or converted to a form that a person who does not have the secret “key” cannot understand.An entire Message, converted to Ciphertext, is a Cryptogram.
44 “Cipher” or AlgorithmA “Cipher” is the process by which PlainText is converted into CipherTextAn Algoriothm is a series of operations that, when performed on the PlainText data, will turn it into Ciphertext.“Cipher” is a catch-all term for a variety of encryption algorithms
45 Key, SecretThe ingredient of the Cipher that is known only to the legitimate parties to the message is the “Secret” or “Key”.Just as a mechanical key opens a lock, the cipher Key makes the data readable again.The words Key and Secret are sometimes interchangeable, but not always (we’ll see why later on…)
46 “Encrypt” < > “Decrypt” Encrypt means to make Plaintext into CiphertextDecrypt is to make Ciphertext back into Plaintext once againSometimes “Encode” and “Decode” are used to mean the same thing.
47 “Attacker”, “Bad Guy”The person or organization who wants to break your crypto-system and find out what the secret message containsPerhaps wants to alter the secret message before it gets to its rightful destinationSometimes, its your own courier, or your own customer!
49 Single Key Ciphers The old “Decoder Ring” OriginalmessageThe old “Decoder Ring”Both ends of the conversation must know the same secret keyOnly one or a limited number of recipientsRecipient can also encrypt messages using the same secret keyHelloCipherKeyCipher-textpjighqrSameKeyCipherKeyRestoredmessageHello
50 What Does It Tell You?Only that whoever sent the message knows the secret key, because,If they didn’t know the secret, they could not have made a valid encrypted message.If more than one other person knows the secret, you can never be sure who sent you any given message.
51 Whole-Message Authentication The entire message is encryptedNo outsider can alter the messageCould be a legal problem because the content is hidden from the authoritiesCan be very slow if the message is large
52 Another kind of Cryptographic Function - Hashing A way to reduce information to a smaller “digested” representationMuch faster than encryption/decryptionDoes not need to be reversibleAny amount of input data makes the same size “Digest” (output)Now is the time forall good men tocome to the aid oftheir party.MESSAGEHASHFUNCTIONDIGEST187B6EF54B079A5C
53 Hashing is Used to Make Sure that Data is Un-Changed Run all the data through the hash functionSend the resulting Hash along with the dataThe recipient can regenerate the Hash and compare it to the one that was sent to check the data for accuracyThis makes transfer of data ultra-reliable
54 An Example of a Simple Hash - A Check Digit System Some companies include Check Digits in their numbering systemsHere’s how Check Digits work:Take a part number or account numberGenerate a simple hash of it (we’ll use SUM)Take all or some portion of the resultEmbed it in the number - Make it a part of the numberAlteration is detected using the hash (check digit)
55 A Simple Hash - Check Digits A typical Part or Account Number:Sum of the Digits = = 45Take just the right-most digit = 5Embed the check digit in the part number:Make an error in entering the part number:System re-computes check digit: = 46The error is obvious: 6 = 5 ???The Check Digit has caught a keying errorbefore it could become a serious problem.
56 Be Sure You Understand! This is an important concept - ASK NOW! Do you understand the concepts of Hashing?Do you understand WHY a Hash can tell us if the data in a message has been changed?This is an important concept - ASK NOW!
57 Larger Scale Hashing Algorithms Can handle very large amounts of input dataCharacteristics that make it more secureLarge output sizeLots of diffusionLots of reductionNow is the timefor all goodmen to come tothe aid of theirparty.MESSAGEHASHFUNCTIONDIGEST187B6EF54B079A5C
58 What Makes a Good Hashing Algorithm? Impossible to figure out any part of the input from the output digestVery unlikely to create a “collision” - the same digest made from different input dataTime-tested, peer-reviewed, and very well scrutinized around the worldApproved and spec’d by the government
59 Secure Hash Algorithm (SHA-1) What is it?How does it work?Why do we use it?It uses several methods to be secure:Diffusing - Each change in an input bit affects many bits of the outputReducing - Much about the input is lost in the course of the computation, keeping the process irreversibleObscuring - More than one input bit can cause changes in the same output bit
60 Secure Hash Algorithm160 bitsRepeat this process 80 times!
61 A Good Example of Peer Review in Action SHA-1 has MANY predecessorsThe Evolution of SHA-1:MD-2 One method, but a little slow, so...MD-4 Weakness was discovered, so...MD-5 Never broken, but suspect, so...SHA Better than any before, but….SHA-1 The most trusted of them all!
62 Hashing Secures A Monetary Balance against Changes A balance is just a very short messageInclude the balance and the Hash of the balance in the iButton memoryIf the balance changes, the Hash won’t match the balance when checkedIf the Hash changes, the balance won’t match the Hash when checkedAny change is detected by the Hash
63 Does a Hash Secure Our Balance Against A “Bad Guy”? A bad guy could just change the balance, and then compute a new hash for itWe would never know that money was addedThe Hash algorithm is only a part of the scheme
64 How to Make It Really Secure? Make it impossible for the Bad Guy to be able to compute a new HashIf he changes the balance, it is detectable because the Hash is no longer correct
65 How to Prevent the Bad Guy from Making a New Hash Oh No! Securityby Obscurity!Keep the Hash algorithm secret?It’s hard to protect an algorithm that is committed to hardware from getting outThere are only a limited number of good algorithms to useCan’t get good peer-review and global acceptance on an algorithm if it is kept secret
66 Keeping A Part of the Message a Secret An unlimited number of different “secret parts” are possibleThe “secret part” can be provided by service providers - They don’t have to trust the iButton manufacturer to keep their secrets, or even know what the secrets areAlgorithm can be made public to allow normal, healthy peer-review
67 Hash A Message Plus a Secret Now is the timefor all goodmen to come tothe aid of theirparty.Mary had alittle lamb.HASHFUNCTIONDIGEST361B73F60A925C
68 Store Message + Hash in iButton, But NOT the secret 361B73F60A925CAttacker is missingcritical informationneeded to alter the dataNow is the timefor all goodmen to come tothe aid of theirparty.Message + Hashstored in iButton
69 Vendor Checks the Message 361B73F60A925CNow is the timefor all goodmen to come tothe aid of theirparty.Vendorknows theSecret PartMary had alittle lamb.HashFunctionIf Hash in iButtonmatches, thethe data is OKRe-CreatedHash361B73F60A925C
70 A New Crypto-Term: MACA MAC is a Message Authentication CodeIt is simply a Hash when a portion of the input is kept secretNo one can compute a valid MAC for an altered balance unless they know the secret
71 Understand MACs and How They Work Call it a “Secret” (It’s not really a “Key”)The input data and secret cannot be figured out from the resulting MACA changed message cannot be augmented to find one that will generate the same MACA MAC is not encrypted data, it is a digest of the message and the secret
72 A Note About Cryptography Most failures of cryptographic systems are failures in their IMPLEMENTATION, and not in the cryptography itselfThere are many short-cuts that can be made that may greatly weaken the securityThere are time-tested rules for crypto-systems and their application
73 Crypto-System RulesNever depend on “Security By Obscurity”. Only full disclosure and peer-review can hope to guarantee a secure crypto-systemBe sure that random numbers REALLY ARE random. Bad random numbers have been the downfall of many crypto systems.Never short-cut or circumvent the time-tested and approved algorithms.
74 Recap - Hashing: What is a Hash? What does a Hash allow us to detect? How would you send a letter so that any changes could be detected?Does all the data involved in the hash have to be sent along?
75 How can we prevent a “Bad Guy” from being able to change the message and then generate a new Hash for it?When a Hash is computed and part of the input data is kept secret, what is the Hash result or digest called?
76 Be Sure You Understand! This is an important concept, so ASK NOW! How can a MAC protect data from unauthorized changes?This is an important concept, so ASK NOW!
77 Back to the eCash iButton Put money balance in the iButton memoryCompute a MAC of the balance and a secretNo one can change the balance and also keep the MAC correct without the secret!
79 Duplicating MoneyEven if the Bad Guy doesn’t know the secret, he can read the balance and valid MACHe could get more iButtons and simply copy the balance and valid MAC into themHe can now spend each of them freely - They all have valid e-Cash!
80 It’s Just Like Copying Currency Make photo-copies of a Dollar billSpend ‘em!Electronic data is even easier to copy, and the copies are impossible to tell from the original
81 How can we Prevent Duplication? What if all copier paper had unchangeable serial numbers embedded in it?Each iButton is unique, because it has a permanent lasered serial number insideWe can include the unique iButton serial number in the input to our MACNow the Bad Guy’s copies are worthless!
82 Be Sure You Understand WHY! Why does including the serial number in the MAC make duplication impossible?This is an important point!ASK NOW!
83 Could the Bad Guy Re-Use the Same iButton? The Bad Guy copies the money amount and the valid MAC to a disketteThe Bad Guy then spends most or all of the money value in the iButtonThe Bad Guy writes the original amount and MAC back into the iButton from the disketteBad Guy spends the SAME money all over again!This is called a “Replay Attack”
84 Make each “copy” of the monetary value unique, too... To do this, we need some hardware help - Enter the DS1963L Monetary iButtonThe DS1963L has a counter that counts up once each time a balance is written into the iButtonWe’ll include the counter in the MAC inputWhen the attacker writes the valid balance and hash back into the device the counter increments, and so the MAC is no longer valid.
85 Counter has Special Properties Counter cannot be reset, backed-up, or re-loadedCounter is BIG, and cannot be wrapped-aroundIt can count to 4,294,967,296!Special precautions detect any attempt to set the counter back or affect it (Tamper Bits)The counter makes each write to the memory a unique event and gives each “instance” of the balance a unique ID
86 Be Sure You Understand!Why does including the counter in the MAC make replay attacks impossible?ASK NOW!
88 Wait Just a Minute! It’s Not Really That Easy! A More Advanced Attack
89 “Faking-Out” the Vendor The clever Bad Guy could make special hardware that can “pretend to be” an iButtonMany micro-controllers and other programmable circuitry can be programmed to “pretend to be” an iButtonThis is called Emulating an iButtonThe Bad Guy copies the valid balance and MAC from a real iButton to his emulation of the iButtonThe Bad Guy uses the emulation iButton as money, sets the counter back each time he restores the original balance (he can do Re-Play attack because he controls the counter)
90 How can we make sure that an iButton is a REAL one? A clever person can figure out how to pretend to be an iButton deviceWe need a way to Authenticate the iButton - To make sure it’s not a fake.?
91 Methods for Authentication How to tell a REAL iButton from an Emulation (a fake iButton)
92 Spy-Vs-Spy: What’s the Secret? How do you make sure someone is not an impostor?Ask for something only the real person should know.If they can answer correctly, then they have authenticated themselvesWhat’s the secret?
93 What if Someone Overhears the Secret? If someone overheard the secret, they could use it later to make us think they were authentic, tooIts not hard to tap into an electronic data “conversation” and record it for use later onYou wouldn’t even know that they have discovered the secret
94 A Better Way to Authenticate Choose a number at randomAsk them to multiply their secret by the random numberThe secret itself was not ever revealed to be compromisedIf a Bad Guy overhears the answer, it will be of no use next time because the random number is always differentWhat’s the secret times 452?
95 Challenge-and-Response The random number is called a Challenge, and the answer is the Response.No one in between the two can fool us, even if we passed the challenge-and-response down a line of intermediaries.Recording the response is of no use in any subsequent transaction
96 Can we Make an iButton that can Prove it is Authentic? We need a special iButton with some new features - Enter the DS1963SIt can keep secrets securely hidden insideIt can compute SHA-1 MACs insideIt can take a Challenge and generate a Response (the MAC of the challenge and a secret)We can test the result to see if the iButton really does know the secret
97 Be Sure You Understand!Why does being able to keep a secret and perform Challenge & Response make it possible for an iButton to be authenticated?Why does the Challenge need to be a random number?This is important, soASK NOW!
98 Security Depends on Keeping a Secret from a Bad Guy The Bad Guy can get his hands on as many of these iButtons as he needs, and he can take them where ever he wants to “work on them” in privacy.
99 Protecting the Secret Secret is stored in static RAM It is maintained by a very small Lithium power cell inside the iButton steel containerBattery connection would have to be maintained during dis-assembly and probe without any interruption, or the secret would be scrambled and lost.
100 A Secure Assembly Method SecretsSilicon Chip(Face Down)Solder BumpsEpoxyUnderfillPrinted CircuitBoardFlip-Chip Technique Makes a “Circuit Sandwich”that would be very difficult to take apart
101 Secure Assembly Silicon hides secrets under metal layers Silicon is flipped and soldered face-down to a circuit boardUltraviolet-light-hardened epoxy is flowed between the silicon chip and the board by capillary actionAlmost impossible to dismantle or probe
102 A Stainless Steel Vault Sealed, Stainless Steel EnclosureIntegral Power SourceCircuit“Sandwich”CircuitBoardLithium BatterySealing the entire device in Stainless Steel makesa very durable package that’s very difficult to open
103 Is all this data REALLY from the iButton? A Bad Guy could bring a valid iButton to authenticate himselfHe could then substitute a fake iButton with illegal money value in it for the transactionCan we be sure the monetary data we read from the iButton really came from the same iButton that we have authenticated?
104 Can We Trust the iButton Data Communications Path? The data connection is vulnerable, exposed to the Bad Guy to manipulate how ever he wishesIt’s not too difficult to switch signals around at the right times using smart electronic devicesCola
105 Be Sure You Understand!How can a simple Challenge & Response exchange guarantee that the data we read really came from the iButton, and not a Bad Guy injecting false information?ASK NOW!
106 Requirements to Perform Secure e-Cash Authenticate the iButton device to make sure its not an EmulationVerify that all of the data has not been in any way corrupted or altered in the communications pathValidate the monetary balance and make sure it has not been altered
107 Accomplishing iButton Challenge and Response A MAC of all the data and a secret would protect the data from being manipulated, and would prove that the device knows the secret, and is therefore authenticThe entire exchange of data to and from the device can be protected from interventionThe device must be able to perform world-class hashing functions - and fast!
108 A Secure Hashing Algorithm We need a secure, trusted, well-tested hashing algorithm implemented in silicon.SHA-1 has all the features we need, and is one of the easier hashes to implement in hardware logic and registers.
109 SHA-1 is No Easy TaskSHA-1 done the “usual” way would take a lot of room, and so the new iButtons be expensive to manufacture (fewer parts can be made from each wafer processed)Instead, we have designed a unique SHA-1 engine that uses a very efficient method to keep the hardware small, and therefore keep the cost down
110 A ‘Special’ SHA-1 Engine Performs the SHA-1 hash in about 500 microseconds ( seconds)Uses very little battery powerOccupies very little silicon spaceImplements an un-compromised FIPS compliant SHA-1 algorithm
111 Authenticate not just the iButton, but the Data from it as well Include the challenge, the balance, the serial number and the secret in the MAC inputNow the MAC, if it checks, proves that the device knows the secret, andThat all the data we got from the device is authentic and accurate, too.Once we know that the data from the iButton is authentic, we can check the MAC on the balance and know that it is valid as well
112 Validate Everything! SHA-1 SHA-1 Match? Serial Number Challenge Random BalanceSecretSecretBalance MACSHA-1SHA-1Match?Un-trusted Connectionbetween iButton & Reader
113 Two MACs for Double Security One authenticates the iButton and the data, and secures the communications link to the deviceOne protects the monetary balance against being changed or faked by a Bad GuyThe entire transaction can be validatedAll of the data is checked
114 Be Sure You Understand!How can a SHA-1 algorithm provide e-Cash security from attackers?Why is it a benefit to have the SHA-1 engine inside the iButton?ASK NOW!
115 Let’s Look at a Real-Life Transaction. Buy a Cola! Touch your Monetary iButton at the Cola Vending Machine readerThe machine generates a random challenge and sends it to the iButtonThe machine reads the balance, the unique iButton serial number, and the counter from the iButtonThe iButton generates a MAC of the balance, serial number, counter and secret
116 The machine reads the MAC from the iButton The machine performs the same MAC computation on the same data, and the secret (that it knows)The machine verifies the match between the two MACs to see if the iButton is authenticThe machine now knows that the iButton is real (the iButton has proved that it knows the secret)The machine also knows that the data has not been tampered with in the communications path.
117 The machine takes the monetary balance, the serial number, and the counter and generates a MAC using the monetary secret (that it knows)If the MAC matches the one from the iButton, the money has been proven to be valid and unalteredThe machine subtracts the cost of the cola from the balance and generates a new monetary MAC using the secret that it knowsThe machine writes the debited amount, with the new valid MAC, back into the iButton
118 Think the Machine gives up a Cola now? Not so fast! What if the iButton left the reader before the new debited balance could be written into it?The money has been validated, but hasn’t been taken from the customer iButton yet!What if a Bad Guy fooled the machine to make it think that the debit was successful, when in fact the iButton was never really debited - because it left just in time?The Bad Guy could buy Colas forever and never spend a single e-penny!
119 We have to do more...The machine generates a new random challenge and reads the device data back againThe machine checks the MAC from the device with the one that it generated to be sure that the iButton and the data is authentic and not just a playback of what the machine wrote out beforeA playback would be the same, but the challenge is new each time and so the response is differentOnly an iButton that knows the secret can make a proper response
120 IF and ONLY IF the balance, serial number, counter and monetary MAC that we read back from the iButton all match what we wrote to it, THEN we know that the entire transaction completed properly, soGive up the cola!(It’s about time!)Ya-Hoo!
121 They call it “Tear”?Another crypto-term: “Tear” - When the media (in this case, the iButton) is taken away before the transaction can be completed and checkedAt most stages in the transaction, we can abort if the iButton device departs too soon, and no harm is done (no money or product has changed hands)What if all is well right up until we try to check and see if the debit was successful, and we find that the iButton has gone away?
122 Accidental, or Intentional? A Good Guy might simply remove the iButton too early by accidentWe need to handle “innocent tear” very well to keep customer confidence and comfortBad Guy could cause precise loss-of-contactBe sure that the result of intentional tear does not produce a profit for a Bad Guy
123 The “Prisoner Exchange” Problem You have something of valueSomeone who you don’t trust has something of value as wellBoth of you wish to exchange these items...How do you do it?He might grab them both and run!He thinks you might do the same!
124 Even a Child Knows... Eye your opponent carefully Try your best to look intimidatingGet into a position where your opponent does not have an advantageMake the exchange suddenly, and quicklyGrab the item you want and don’t let go!
125 We Handle it the Same Way Make sure the iButton is real and the money contained in it is validMake the transaction as quickly as possible (to reduce the odds that “tear” will occur)Don’t give up the product until they prove that they gave up the money (by staying long enough to read the iButton back)
126 “Tolerate the incompetent humans, they know not what they do” The philosophy for dealing with tear is very important in e-Cash vending system designWhat if we simply refuse to give up product?“Let the transaction finish, or NO COLA!”The thirsty and frustrated human is very likely to present the iButton againOur machine will just wait for the iButton to return and finish the job when (and if) it does
127 Alternative Philosophies Money could be lost if the human walks away and indeed WAS debited, but that’s a loss we will have to live with.The alternative would be to vend the product, but that would open the system up to attacks and greater losses (because tear would now become profitable for the Bad Guy)
128 Be Sure You Understand!Do you understand what Tear is and why it could be a problem?ASK NOW!
129 That’s a LOT of Work It took four hashing operations in the machine: One to check the data and iButton authenticityOne to check the monetary balance for validityOne to generate a new MAC for the newly debited monetary balanceOne to check the data read back when we verified that the debit completed properly
130 And it took two hashing operations in the iButton: One to generate a MAC for the data that the machine read when the iButton arrived, andOne to generate a MAC for the data that the machine read back to check that the debit completed.
131 What Else can they Throw at Us? As we have seen, it is very important that the vending machine read the iButton back after the debit to be sure that it “took”.But, if the iButton appears to have been properly debited, how do we know that the debit was our own?
132 This next one is a bit Complicated... The A-B-A Cheat
133 B A scenario for yet another way of cheating: Bad Guy attempts to buy a cola from Machine ABad Guy removes the iButton before the debit can be read back and checked by the machineBad Guy goes to Machine B using the same iButton (which has not been debited)Bad Guy allows the full transaction to complete at Machine B, and gets a cola. His iButton is debited for the cost of one cola.So far, so good.B
134 A Bad Guy now returns to machine A and touches the same iButton again Machine A reads the iButton, observes the correctly debited amount, the correct serial number, and the correct counter value and assumes that it (A) had completed the prior transaction after all. It thereby assumes that it owes this customer a cola!Machine A vends a Cola.A
135 Customer got two Colas for the price of one! And the cost of one Cola has been added to two different coin boxes! We have duplicated money!(Banker-types consider it very bad if cola machines create new money on their own)
136 Preventing the A-B-A Cheat Each vending machine includes a random number with the balance (we’ll call it a Transaction Code)This Transaction Code number is included in the iButton with the balance, and is a part of the input to the monetary MAC computation as well.When an iButton departs and then returns, the random value is not at all likely to be the same if the iButton was in fact debited by a different machine, or at a different time.The debit in Machine A is found to have not completed, no duplicate product is vended, and no new money is created.The customer got one Cola for one Cola-price.
137 But, that’s not all. There are MORE problems to think about... What if someone DID get into an iButton and get that precious secret out of it?The same secret is used by all the iButtons in the Service Provider’s entire system, soAll the iButtons that use the same secret would be compromised!
138 New Crypto-Term: Class Break When all the devices in a system are broken by breaking a single device.The consequences of a Class Break would be very serious indeed!Making a system-wide key change across millions of deployed iButtons would be almost impossible - and very costly
139 How to Prevent a Class Break Reduce the odds or increase the difficultyBetter physical security (expensive and ultimately limited)Catch ‘em in the act of trying to break the deviceBooby-traps that wipe the secret when you try to break in and get it (expensive, sometimes they might false alarm and erase legitimate money, also ultimately limited)
140 A Different Secret for each iButton? Legitimate vendors would have to know every secret for every iButton that might arriveThere could be millions of secrets!Requires huge memories, or network connections at each and every vending machineA database nightmare!
141 A Better Way to put a Unique Secret in Each iButton Give each device a secret that is computed from a master secret and the unique device serial numberThe method should make it impossible to figure out the master secret given the unique device secretWe will need a fast way to re-create each devices unique secret when it arrivesSound familiar?
142 Use our SHA-1 Hashing Algorithm to Make Unique Secrets Each iButton is given a secret that is the MAC of the master secret combined with its unique serial number.The cola machine reads the device serial number when it arrives and, knowing the master secret, figures out the unique secret for the device.Now we’re up to seven hash operations per transaction!MasterSecretSerial NumberDevice SecretSHA-1Used toAuthenticateData from iButtonUnique DeviceSecret
143 Be Sure You Understand! Do you understand what a Class Break is? Why does having a different key in each iButton prevent a Class break?ASK NOW!
144 All those MACs! Won’t it take forever just to buy a Cola? Now we’re doing seven complex MAC operations in each transactionA MAC operation involves thousands of steps and lots of computation
145 Time to Perform a MAC?In a typical micro-controller, could be as slow as 1/2 second or more for each MACThat would be 3.5 seconds or more just to do this simple Cola transaction!
146 The DS1963S as a Co-Processor Another DS1963S can also be used inside the vending machine as a co-processor iButtonSHA in seconds!It can also keep the critical secrets, and store the collected money safelyColaiiOutside,serving aspersonal e-cashInside, doingthe crypto workat very high speed
147 The Ultimate Co-Processor The Monetary iButton can perform MACs very quicklyIt has functions that allow it to check MACs from other iButtons without revealing the sensitive secretsIt can keep the secrets better than any micro controllerIt has its own unique serial numberIt has its own stainless-steel vaultIt has its own backup power cellIt is a safe place to store accumulated fundsIt has room for configuration and price dataIt can be easily installed, retrieved or exchangedIt is inexpensive
148 Be Sure You Understand!Do you understand how the same DS1963S iButton can be both an eCash carrier and a co-processor?ASK NOW!
149 What about other Points of Risk? The biggest risk is often the people or systems at the service providers own facilitiesEmployees could profit by stealing the master secrets that they may have access to at workMaster secrets must be kept under lock-and-key, and security of that type is expensive and doesn’t always work reliably.Cryptography comes to the rescue again with “Secret Sharing” methods...
150 Protecting the Master Secrets Another crypto-term: “Secret Sharing”Breaks the master secret into several “partial secrets”Partial secrets may be distributed among VIPs or kept in different vaults (physical or electronic, like CiBs).No single employee needs to ever have access to all the partial secrets.No partial secret is of any use without all of the others.Partial secrets must be brought together only when the master secret is to be re-created
152 Still at Risk?Even secret sharing schemes can’t fully protect the master secretThe Master Secret still exists, if even for a moment in a computer, when the partial secrets come together and the master is injected into the iButtons.Unless…..
153 Assemble the Partial Secrets inside the iButton Use the Hash mechanism inside the Monetary iButton as a secret sharing toolRe-build the master secret entirely inside the confines and security of the iButtonThe master secret NEVER exists outside the iButton, and is NEVER exposed to employees or anyone elsePartial secrets can be injected at various points along the process, even in different cities or factoriesThe final partial might not be injected until the iButton is given value and handed to the customer. Any iButton taken from the system before that step is useless to an attacker.
154 Assemble Partials in the iButton Partial SecretMaster SecretWe send each partial into the iButton and buildthe new master secretone-by-one. The resultsare never exposed outsidethe iButton.SHA-1
155 Be Sure You Understand! Do you understand how Secret Sharing is done? Understand WHY?ASK NOW!
156 Recap: A Scheme and iButton for Secure e-Cash Provides a secure steel container for eCashSecures a monetary value using a HashUses the unique iButton ID to protect monetary value against duplicationUses non-resetable counters to protect monetary value against Re-Play Attacks
157 Secure e-Cash, cont’d... Provides a fast, efficient crypto engine Generates a unique secret for each and every iButton - No Class Break problemAuthenticates the iButton using Challenge & Response, and the secret in the iButtonChecks all the data from the iButton using a Hash and the secret in the iButton
158 Secure e-Cash, cont’d...iButton can also be a co-processor to keep secrets and to speed up transactionsProvides user authentication by challenging the human carrier to prove he knows a secret PIN or passwordProvides secret-sharing to protect the secrets at the service providers facilities
159 There’s One Attack Left... What about the Bad Guy who simply wants to BREAK the system?
160 The Sneakiest Attack of Them All The “Competitor Attack” Most attackers wish to profit from their effortsCompetitors may profit by simply breaking the system, causing customers to distrust itThe simplest attack is to destroy the device, but that leaves obvious evidence behindAnother method is to corrupt the monetary data in the device, but that would also be somewhat obviousThe “sneakiest” attack would be to corrupt the secrets. Since they cannot be read out, no one could be sure if a non-working part had been scrambled or had simply failed.
161 A Counter on the Secrets An attempt to make competitor attacks more easily detectable and obviousLike the data pages, each secret also has a counter that goes up one count when the secret is changedThis can be used to detect over-written secrets as opposed to hardware or memory failures.The secret counter can be included in the monetary MAC to lock the monetary value even more tightly to the state of the iButton and secret.
162 Be Sure You Understand!Do you understand why someone would want to disrupt the system even if they did not profit directly from their attack?ASK NOW!
163 The DS1963S eCash iButton Securely stores monetary balances Can be reliably authenticatedCan reliably authenticate a userDetects alteration of the monetary balanceDetects alteration of the I/O data exchangedDetects alteration of the secretsPhysically secure, durable steel containerFast, efficient internal cryptographic engine
164 Can the DS1963S iButton only Represent Money? Other data may also be securedSecure employee informationSecure access rights, door lists, security levelsSecure credit card informationSecure photographSecure biometric DataTamper-Proof Employee/Student IDEmployeeID CardBob Jones
166 User AuthenticationThe Internet needs a way to authenticate users - to make sure they are really who they say they are - before allowing them access to sensitive informationSoftware systems need a secure way to authenticate usersAccess Control and Door Lock systems need more reliable and secure “keys”
167 Problems Handling PINs and Passwords For an Internet server, handling thousands (or millions) of user PINs or passwords is a huge taskThe time to authenticate a user includes looking up their PIN or password in the huge databaseHaving many copies of a database of user secrets makes them more easily compromisedSending PINs or passwords over the network raises the risk of their interception
168 PIN/Password –vs- Tokens PINs & Passwords are easily compromisedYou will not always know if your PIN or password has been compromisedTokens (like keys, cards or iButtons) can be stolen and used by someone elseYou know when the physical token is missing (it’s not there when you need it)
169 A Better Way… Combine the best of Tokens and Passwords Something You Bring (the Token)Something You Know (your Password)
170 “Something You Bring, Something You Know…” The authentic user must bring a unique, physical token and present it,The authentic user must know something that is secret, and prove that he knows it,Only when both the secret and the token are present is the user truly authenticated.
171 Bind the User to the Token Include the user’s PIN or Password as if it is the last partial secretBinds the User to the iButton TokenThe user must provide the correct PIN or Password before the device can be authenticated
173 The Monetary iButton as a Key Access Control, Safes, Lockers, Stand-alone Door Locks all need versatile electronic keys that cannot be duplicated.Because data can also be protected from alteration, access levels, door lists, and employee ID can be stored securely in the iButton as well.
174 Accessory Authentication Manufacturers want to be sure that customers use only genuine accessoriesSecret-keeping and Hashing can allow an appliance to authenticate the accessories that are connected to it, and refuse to work with third-party knock-offs
175 DS1963S iButton Capacity Sixteen data pages Eight secrets Eight data page write countersEight Secret write countersTotal 5.12K Bits of battery-backed RAMDataDataDataDataDataDataDataDataDataDataDataDataDataDataDataDataDataDataSecretCounterCounterSecretCounterCounterSecretCounterCounterSecretCounterCounterSecretCounterCounterSecretCounterCounterSecretCounterCounterSecretCounterCounter
176 Multiple Service Providers As many as seven service providers can share the deviceEach providers space is independent from the othersDS1963SCitiCorpNationsBankEat At Joe’sEtc...
177 1-Wire File Compatible1-Wire File directory and file structures may be used throughout1-Wire File directory pages can be protected, tooAllows dynamic RAM memory allocation as providers are addedFile DirectoryOther Page...File Page 0File Page 1Other Page...File Page 2
179 The “Brute Force” Attack Any and every cryptosystem is susceptible to a “Brute Force” attackThe attacker simply tries each and every possible key until one worksTime depends on maximum rate that keys can be tried and number of possible keys
180 Is a 64-bit Secret Big Enough? On average, finding out the secret would require (2^64)/2 SHA operations, or about 9,223,000,000,000,000,000 computations.A very fast computer can perform a SHA-1 computation in about 1 microsecond.It would take about 2,900 years using 1000 ultra-fast computers to break the secret!
182 Other Crypto-Attacks?“There are no known cryptographic attacks against SHA.” - Applied Cryptography, Second Edition, by Bruce Schneier 1996
183 iButton Data Security-Vs-Cost Very Secure,Low CostUltra Secure,High CostDS1963SNext-GenerationMonetary iButtonDS1955/DS1957Java-powered CryptographiciButtonMoreSecurityDS1963LMonetary iButtonDS199XMemoryiButtonsDS1991Password-ProtectedMemory$$$$Higher Cost
184 The DS1955/DS1957 Cryptographic iButton The Java-powered Cryptographic iButton has even better physical and electronic security:More metal layers covering secretsFreeze and other tamper detectors“Instant Zeroization” wipes secrets quicklyPerforms Dual-Key Encryption very fastCan help limit the scope of some attacks through its programming capabilities
185 DS1955/DS1957 also has Drawbacks... More expensive (very large die size)Illegal to export or sell to some customersMuch more versatile, but not as fast in performing some operations, like SHA-1Difficult to justify for “small cash” use
186 The Competition for Authentication What’s the secret word?
187 Dedicated Hardware Lock-and-Key Chipsets They use much weaker algorithms and small key sizes - subject to simple attacksMost of them use “Security By Obscurity” and try to keep their algorithms a secretThey have no built-in provisions to authenticate the userSteal a key and you can use it any time
188 e-Cash iButton Applications Bus/Train FaresParking MetersTelephone CardGasoline CardMulti-Credit CardStudent Union CardUtility Use MeteringLocker/Post Box Access
189 ConclusionsThe Monetary iButton DS1963S can be a secure, effective and versatile e-Cash token.Levels of physical and cryptographic security are suitable for dollar amounts similar to what a person might carry in a purse or wallet.A world-class algorithm in its pure form attains higher levels of monetary and data security for the cost than ever before.
190 The Monetary iButton does not perform encryption, and so is free of export and national security restrictions.The Monetary iButton makes an excellent user authentication token for Internet, Intranet or other electronic user authentication applications.
191 It just keeps getting better! More Uses for the DS1963SIt just keeps getting better!
192 Small Message Encryption One Time Pad is a fundamental concept of cryptographic theorySHA-1 (being irreversible) make a great One-Time-Pad generator
193 Theory of the “One-Time-Pad” Given a message byte, called the PADXOR the byte with a secret random byteThe result is a random number!No information about the original byte remains so long as the PAD byte is unknown.This is the most SECURE cipher possible!
194 Pads are the most basic cipher Both parties to the conversation share the same padThe pad is created entirely using random numbersIt is unbreakable!(So long as the PAD is never be used again! Each pad is good for ONE message.)
195 Use SHA to Generate Pads MAC is essentially random if you don’t know the secret used to make itIrreversible - Pad cannot reveal secretMAC data serves as One-Time-PadSecrets never leave the safety of the iButtonWork is done in the iButtonHost does only simple byte-wide XOR
196 Randomize to Prevent Replay Inject a random challenge (called a “salt” in this case) to make each message randomInclude the challenge in the message
197 Small Message Encryption SecretRandom NumberSHA-1Cipher-TextMACNow is the time forall good men tocome to the aid oftheir party.Ciphertext
198 Small Message Decryption SecretRandomNumberSHA-1Cipher-TextMACNow is the time forall good men tocome to the aid oftheir party.Ciphertext
199 The DS1963S for Small Message Encryption/Decryption Every message appears entirely random (even the same message repeated)20 bytes of One-Time-Pad in about 1msWorld class security at very low costMicro needs only perform XOR functionSecrets are stored safely in DS1963SBuilt-in Secret rotation facility
200 Anonymous Authentication We don’t know WHO he is, but we know he’s REAL!
201 Voting SystemsVoting systems need to securely authenticate each and every voterVoter identity must be kept secret – each person’s vote is private.The DS1963S authentication schemes that we have described all require the server to know the token serial number
202 Anonymous Authentication Do not bind the secret to the ROM ID (serial number) of the deviceAgent (local computer or iButton reader) does not send the ROM ID to the serverServer can authenticate the iButton, but does not get an identity from the iButton
203 New SHA devices with EEPROM The DS1961S and DS2432New SHA devices with EEPROM
204 Features One secret, four data pages 8-byte scratchpad (versus 32 bytes)Write to memory cannot be performed without proper MAC (you must know the secret to write to the device)Slightly slower SHA computationBattery-less!
205 Drawbacks One secret (one service provider) Not equipped to serve as a co-processor (designed to work with the DS1963S as a co-processor)EEPROM has some special problems in intermittent contact environmentsLimited EEPROM write cyclesDoes not have anonymous capability
207 Future DS1963S co-processor in IC package DS1961S token with anonymous modeA “Debit-Only” Co-ProcessorSHA-1 security in other devices
208 (That’s French for THE END) FIN(That’s French for THE END)
209 e-Cash - “Electronic Money” The DS1963S eCash iButtonWho I Am:Hardware and Software EngineerA student of cryptographyWrote crypto iButton comm layersWarnings:WE WILL COVER MANY THINGS YOU MAY ALREADYKNOW VERY WELL.This session is intended to give a ageneral understanding of the DS1963S and the methods we use to secure money and data in it.