Hardware Reference
In-Depth Information
Adding the keypad
We're going to need a way to enter this code into the BBB. This code is used to populate
one of the TPM's PCRs that will be used to seal the GPG key. This keypad will be connec-
ted to the ATmega328p on the CryptoCape. While the BBB is more than capable of hand-
ling the I/O for the keypad, by using the ATmega328p, we take advantage of code reuse.
For most hardware products in the SparkFun catalog, there exists at least an unofficial Ar-
duino library. If the components aren't available at SparkFun, then you should be able to
find similar parts from the product descriptions. In the case of the keypad, there is an offi-
cial library. The hardware for this project is listed in the following table:
SparkFun number
F/F jumper wires
Male breakaway headers PRT-00116
To build this Arduino library, you'll first need to install the Keypad library from the Ardu-
ino playground site: http://playground.arduino.cc/code/Keypad . Then clone the following
repository from GitHub:
git clone https://github.com/jbdatko/
In the ch4 code folder, you'll find both the keypad.ino source and the compiled hex
that is ready to be loaded onto the 328p. From Chapter 3 , Adding Hardware Security with
the CryptoCape , remember that compiled sketches can be uploaded to the ATmega328p
with the following command, just be sure to install the program jumpers:
sudo ./upload.sh keypad_cryptocape.cpp.hex
This program has the 328p joining the I2C bus at hex address 0x42. It then waits to receive
data from an I2C master device, the BBB, and then will collect your five-digit code from
the keypad. You have ten seconds to enter a five-digit code and the timer starts once the
Search WWH ::

Custom Search