]> git.gir.st - sendHID.git/blob - README.md
am bored, added nice error screen on parameter count mismatch
[sendHID.git] / README.md
1 # hardpass
2 A hardware password manager, built around a Paspberry Pi Zero and [`pass`, the UNIX password manager](https://passwordstore.org).
3
4 This is also an entry for [Hackaday.io](https://hackaday.io)'s Pi Zero Contest.
5
6 ## Hardware
7 I am using a Raspberry Pi Zero, since it has USB-OTG support and a lot of GPIO to interface an OLED screen, a button matrix for input and maybe even an ESP8266 for WiFi.
8 The OLED I am intending to use has an I²C interface and a screen diagonal of .96".
9
10 ## using the driver
11 The neccessary drivers are available only in the Raspbian 4.4 Kernel, which you can install using
12 ```
13 sudo BRANCH=next rpi-update
14 ```
15 You also need to activate the device tree overlay `dwc2` and load the corresponding kernel module:
16 ```
17 echo "dtoverlay=dwc2" | sudo tee /boot/config.txt
18 echo "dwc2" | sudo tee /etc/modules
19 ```
20
21 To use this program, you have to enable the `libcomposite` driver on the Raspberry Pi and create a USB HID gadget.
22 You can use this bash script:
23 ```
24 #!/bin/bash
25 # this is a stripped down version of https://github.com/ckuethe/usbarmory/wiki/USB-Gadgets - I don't claim any rights
26
27 modprobe libcomposite
28 cd /sys/kernel/config/usb_gadget/
29 mkdir -p g1
30 cd g1
31 echo 0x1d6b > idVendor # Linux Foundation
32 echo 0x0104 > idProduct # Multifunction Composite Gadget
33 echo 0x0100 > bcdDevice # v1.0.0
34 echo 0x0200 > bcdUSB # USB2
35 mkdir -p strings/0x409
36 echo "fedcba9876543210" > strings/0x409/serialnumber
37 echo "girst" > strings/0x409/manufacturer
38 echo "Hardpass" > strings/0x409/product
39 N="usb0"
40 mkdir -p functions/hid.$N
41 echo 1 > functions/hid.usb0/protocol
42 echo 1 > functions/hid.usb0/subclass
43 echo 8 > functions/hid.usb0/report_length
44 echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
45 C=1
46 mkdir -p configs/c.$C/strings/0x409
47 echo "Config $C: ECM network" > configs/c.$C/strings/0x409/configuration
48 echo 250 > configs/c.$C/MaxPower
49 ln -s functions/hid.$N configs/c.$C/
50 ls /sys/class/udc > UDC
51 ```
52
53 ## modifying `pass`
54 The version of (pass)[https://passwordstore.org] doesn't format the output as nice, so it is easier to work with. Using the `pass-installer.sh` will automatically clone from the original repository, apply the patch and install it (make sure, `patch` and `sudo` is installed).
55
56 You can then check out `hardpass-demo.sh` to see how to supply a passphrase directly from the command line (without gpg-agent). Keep in mind, that it will show up in your history file!
Imprint / Impressum