The Hashlet now has a command line interface.

The first batch of Hashlet boards are on their way! The software is coming along and is now available on Github. It’s in alpha, but quickly gaining features. Currently, it supports obtaining 32 bytes of random data from the Hashlet’s hardware random number generator. The proper incantation is:

./hashlet /dev/i2c-1 random
62F95589AC76855A8F9204C9C6B8B85F06E6477D17C3888266AEE8E1CBD65319

For those that have received prototype units, your random number will be FFFF0000FFFF0000. This is because your device has not been personalized yet. After personalization (when your keys are loaded), you will be able to pull random data from the device.  I have some of the infrastructure for the personalization process, but it’s not quite ready yet so stay tuned.

If you want all-the-details, use the -v option. You’ll see the all the commands being sent and received. The debug output is very verbose at the moment, which I need to clean up. Eventually, I want to make this a kernel module with a nice character-device like sysfs. The monolithic app is a good start.

debian@arm:~/repos/hashlet$ ./hashlet /dev/i2c-1 random -v
Device is awake.
crc : 0x33 0x43
Calculated crc : 0x33 0x43
*** Printing Command ***
Command: 0x03
Count: 0x07
OpCode: 0x1B
Command Random
param1: 0x01
param2: 0x00 0x00
CRC: 0x00 0x00
Wait time: 0 seconds 11000000 nanoseconds
Total len: 8, count: 7, CRC_LEN: 5, CRC_OFFSET: 6

Sending : 0x03 0x07 0x1B 0x01 0x00 0x00 0x27 0x47
Read failed, retrying
Read failed, retrying
Read failed, retrying
Read failed, retrying
Read failed, retrying
Read failed, retrying
Read failed, retrying
Read failed, retrying
Received RSP : 0x23 0xA1 0xFB 0xC6 0xDA 0x35 0xF1 0x97 0x24 0x66 0x41 0x44 0xC7 0x77 0x71 0xAA 0xBF 0xB5 0x18 0x46 0x29 0xEF 0xCB 0xF9 0x85 0x0B 0x5F 0x17 0xE4 0xF7 0xD6 0x8F 0x46 0x13 0x47
crc : 0x13 0x47
Calculated crc : 0x13 0x47
Random: : 0xA1 0xFB 0xC6 0xDA 0x35 0xF1 0x97 0x24 0x66 0x41 0x44 0xC7 0x77 0x71 0xAA 0xBF 0xB5 0x18 0x46 0x29 0xEF 0xCB 0xF9 0x85 0x0B 0x5F 0x17 0xE4 0xF7 0xD6 0x8F 0x46
A1FBC6DA35F19724664144C77771AABFB5184629EFCBF9850B5F17E4F7D68F46