Dallas Semiconductor SHAiButton 1963S DemoPrograms ------------------------------------------------------------- KLA 9-22-00 This file describes the demonstration programs to be used for the DS1963S. You will need two DS1963S devices (family code 18) for these demos. ------------------------------------------------------------- I. initcopr.class ----------------- This is the first program you should run. It initializes the coprocessor iButton. When you run this program, have the iButton you would like to use as a coprocessor attached to the OneWire. The program will install the coprocessor file on the first DS1963S it finds, so you may wish to only have one iButton on the OneWire. When you run the program, the first line you should see is: > Enter the name of the service file (4 characters) : This service file name should uniquely identify the service group you will use. A file by this name will be placed on the user/ roving SHA iButton. >Enter authentication page number (7) : The authentication page number is the page that will be used to store the authentication secret. Use this secret to see if a roving iButton belongs to the service group this coprocessor works for. Default value is page 7. Hit enter to accept the default value. >Enter workspace page number (9) : The workspace page is used by the coprocessor to re-create a user iButton's authentication secret. The coprocessor stores the 'base' secret. User iButtons take that base secret and make it unique by hashing it with their ROM IDs. Default value is page 9. Hit enter to accept the default value. >Enter version number (1) : The version number of the service. Default value is 1. Hit enter to accept the default value. >How would you like to enter the binding data (32 bytes)? > 1 HEX > 2 ASCII > ? The binding data is used to bind the authentication secret to the user iButton. You can enter this data in Hex or in ASCII. Enter your choice and then hit enter. You can then type the data you will be using. You can enter any amount of data--the program will force it to the correct length by adding padding or cutting excess bytes out. >How would you like to enter the binding code (7 bytes)? > 1 HEX > 2 ASCII > ? The binding code serves the same function as the binding data. You enter it in the same manner. >Enter a human-readable provider name: This could be the company that provides this service group. It can be a string of any length (limited by the memory in the coprocessor iButton). >Enter an initial signature in HEX (all 0' default): The initial signature is used when the coprocessor is signing a user iButton's money. To use the default, hit enter. >Enter any additional text you would like store on the coprocessor: Any kind of information you would like available on the coprocessor should be entered here. >Enter an encryption code (0): It may be useful to store signed data in an encrypted manner. This stores a code that could be used to tell what kind of encryption to use. The default value is 0. Hit enter to accept the default value. The program then echoes the coprocessor file and some other data. This can be ignored, but may be useful in developing. >How would you like to enter the signing secret (unlimited bytes)? > 1 HEX > 2 ASCII > ? The signing secret is used by the coprocessor to sign pages. The data entered will be broken into partial secrets and installed on the coprocessor iButton. Enter this data the same way you entered the binding code. The secret will be echoed after entered. >How would you like to enter the authentication secret (unlimited bytes)? > 1 HEX > 2 ASCII > ? The authentication secret is what tells the coprocessor that an iButton does or does not belong to the group. Enter this data the same way you entered the binding code. NOTE that you will need to remember exactly what you entered for this, as you will need it to initialize the roving/user iButton. The secret will be echoed after entered. Upon success, the following messages will print: >Signing secret installed. >Authentication secret installed. The program is now complete. II. initrov.class ----------------- Leave your coprocessor iButton on the OneWire, and also attach the iButton you will use as a user iButton. The program will first look for coprocessors. If it finds one, it will print: >How would you like to enter the authentication secret (unlimited bytes)? > 1 HEX > 2 ASCII > ? Enter the exact same data you entered in the last part of the coprocessor initialization. The following will print if the program finished correctly: >Authentication secret installed. >Authentication secret bound to ibutton >Succesfully set up user iButton III. debit.class ---------------- Your user iButton has now been initialized with 100$. You can run the debit program with both buttons attached. Some messages will print up. Your messages may not look exactly like this, but you will see something along the lines of: >Couldnt find the file page!!! >Found a coprocessor for service "DLSM" The first line is actually the program checking to see if the user iButton is a coprocessor. This fails, but then the program finds the real coprocessor. Remove the coprocessor and re-insert it. You should see something like: >New iButton Inserted: a6000000028dce18 >** Coprocessor SHA iButton: 260000000261f718 >** Provider file: DLSM.102 > >----------------------- >| Device : a6000000028dce18 >| Balance : $ 99.50 US >| Transaction time : 220 ms >----------------------- You can continue removing and inserting the iButton to show more transactions. Occasionally, the transaction will fail. This is usually due to poor contact with the reader. In most cases, you can just try again. The error messages that claim "You do not belong to the system" only mean that the transaction failed in the user authentication portion--it could be that you do not belong to the system or a communication failure occurred at that point.