Skip to content

Commit 23261bf

Browse files
authored
Update README.md
1 parent 15fdaae commit 23261bf

1 file changed

Lines changed: 276 additions & 7 deletions

File tree

README.md

Lines changed: 276 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,54 @@ Python client for interacting with the OnlyKey.
44

55
OnlyKey-cli - A command line interface to the OnlyKey that can be used for configuration (Similar functionality to [OnlyKey App](https://docs.crp.to/app.html))
66

7+
<!---
8+
PGPMessage - **Still in early development.** - Provides a tool for decrypting and signing OpenPGP/GPG messages using OnlyKey (python only OpenPGP implementation).
9+
10+
11+
12+
## Run without installation (Packaged App)
13+
14+
### Mac OS Run without installation
15+
16+
Tested on El Capitan
17+
18+
Pre-compiled packaged apps have been provided here:
19+
20+
[OnlyKey CLI](https://github.com/trustcrypto/python-onlykey/releases/download/v0.1-alpha.1/cli)
21+
22+
[OnlyKey PGP Message Tool](https://github.com/trustcrypto/python-onlykey/releases/download/v0.1-alpha.1/PGP_message)
23+
24+
Once the file is downloaded in order to be able to run just by double clicking the file do the following:
25+
1) Open the terminal app and make the file executable with this command:
26+
```
27+
$ chmod +x <location of file you downloaded>
28+
```
29+
2) Right click the file and select "open"
30+
31+
These have been tested on Mac OS (El Capitan), we are still working on getting packaged apps that will work on other platforms such as Windows.
32+
33+
### Windows Run without installation
34+
35+
Coming soon
36+
37+
## Installation
38+
39+
### Windows Dependencies
40+
41+
Python 2.7 - https://www.python.org/downloads/release/python-2713/
42+
43+
git - https://git-scm.com/download/win
44+
45+
## Mac OS Install
46+
47+
Tested on Sierra
48+
```
49+
sudo pip uninstall crypto
50+
sudo pip uninstall pycrypto
51+
easy_install pycrypto
52+
```
53+
--->
54+
755
## Installation
856

957
### Windows Install
@@ -13,7 +61,7 @@ OnlyKey-cli - A command line interface to the OnlyKey that can be used for confi
1361

1462
3)
1563
```
16-
$ pip install onlykey
64+
$ pip2 install onlykey
1765
```
1866

1967

@@ -29,23 +77,23 @@ This is usually c:\Python27\Scripts\onlykey-cli.exe
2977
Python 2.7 and pip are required. To setup a Python environment on MacOS we recommend Anaconda https://www.anaconda.com/download/#macos
3078

3179
```
32-
$ pip install onlykey
80+
$ pip2 install onlykey
3381
```
3482

3583
### Ubuntu Install with dependencies
3684

3785
```
3886
$ apt update && apt upgrade
3987
$ apt install python-pip python-dev libusb-1.0-0-dev libudev-dev
40-
$ pip install onlykey
88+
$ pip2 install onlykey
4189
```
4290

4391
### Debian Install with dependencies
4492

4593
```
4694
$ apt update && apt upgrade
4795
$ apt install python-pip python-dev libusb-1.0-0-dev libudev-dev
48-
$ pip install onlykey
96+
$ pip2 install onlykey
4997
```
5098

5199
### Fedora/RedHat/CentOS Install with dependencies
@@ -54,20 +102,20 @@ $ pip install onlykey
54102
$ yum update
55103
$ yum install python-pip python-devel libusb-devel libudev-devel \
56104
gcc redhat-rpm-config
57-
$ pip install onlykey
105+
$ pip2 install onlykey
58106
```
59107
### OpenSUSE Install with dependencies
60108

61109
```
62110
$ zypper install python-pip python-devel libusb-1_0-devel libudev-devel
63-
$ pip install onlykey
111+
$ pip2 install onlykey
64112
```
65113

66114
### Arch Linux Install with dependencies
67115

68116
```
69117
$ sudo pacman -Sy git python2-setuptools python2 libusb python2-pip
70-
$ pip install onlykey
118+
$ pip2 install onlykey
71119
```
72120

73121
### FreeBSD Install with dependencies
@@ -316,7 +364,228 @@ OnlyKey>
316364
317365
Bye!
318366
```
367+
<!---
368+
### Decrypt PGP email messages using OnlyKey
369+
370+
If you using a previously set RSA private key with decryption capabilities you can decrypt OpenPGP/GPG encrypted email messages:
371+
372+
```
373+
$ PGP_message.py
374+
```
375+
376+
`Do you want to sign or decrypt a message?`
377+
`s = sign, d = decrypt`
378+
```
379+
d
380+
381+
Enter RSA key slot number to use (1 - 4) or enter 0 to list key labels
382+
383+
2
384+
385+
Paste OpenPGP Message, press return to go to new line, and then press Ctrl+D or Ctrl+Z (Windows only)
386+
387+
-----BEGIN PGP MESSAGE-----
388+
Version: Mailvelope v1.7.1
389+
Comment: https://www.mailvelope.com
390+
391+
wcFMA322sr0GLHtKAQ/9Hxs3Fe7vNMGMAphp5ddJCBYSx8aL4N1JRS5O3mrw
392+
KkJfNlHn0YcMoC2J4iMrHTNWj0JeyQiGy5mwstAqL8g5Or8HBuqKTycfhHJV
393+
mfTvXhRTE9WY+0JqYBbg02MjKzYuqrhCKfsu9+T/q58T/75XYE8bYwehsXpJ
394+
2stjIj+wjrRRk4Dx/nGegUAmIAAQPmeizzOwLgJbBSZgK1pfrKwuCOpdxH8v
395+
QRLoX2abpipGhhpkhje2PAtTlX2CGES857KThwFzeAJj94k+VAYfsZOi65gg
396+
yMeF3h8V8KugBnZY9kOJFbi5j84iflvgZa/ZlMzLLHWDhgeYQR7rE/zZxIgL
397+
CjW1Iq2QibM8ug7ri4MfxhrHGN9Ci1EnnIVbMHq4kcPrCr20qouZqbXPuXcG
398+
pJ2eKQahH7Zz9cwNB6FoVgG23z9YYp3Q2tS9Cm9hvzJz+dPvy+OvmVqw4oCF
399+
y4yvFRj82xoL7pDzhAPgeC7d3I4zV2Q9ObV5rQFBe8W1G0eukoS3k/UZJXJO
400+
hIw0VBaYkw0MivKceezk36KhgA4LhNQxiOx0YVk+YYryRC7muyYtRlDoSpGe
401+
1dqI+rBDayvsW4hHu5Y6Sb5N1LnHBZg7OSsz/S5fSAR4lcWpbSF3vyBl3tPQ
402+
mVcbHFgpPjUq71lU31RyqybmkBLdYNNvX8iGeZXWIVTSXgHalMeNCTLiL/yr
403+
JZWTQif+8lfAh3aERtqaJRowOxM/fVutJ7Y+xA+fAEeqzbO8cFvik+ww/8Km
404+
uk2Px9ELdgmlEJQ7IXp1hp46r9tv3lqHmtDyL5t/XL+R7QMjI3Y=
405+
=TBU9
406+
-----END PGP MESSAGE-----
407+
^D
408+
409+
You should see your OnlyKey blink 3 times
410+
411+
Sending the payload to the OnlyKey...
412+
413+
Please enter the 3 digit challenge code on OnlyKey (and press ENTER if necessary)
414+
2 5 2
415+
416+
Trying to read the decrypted data from OnlyKey
417+
For RSA with 4096 keysize this may take up to 9 seconds...
418+
419+
Decoded Decrypted Message = ?3umsg.txtX?E?Secret message that I want to encrypt!?????6?*?gQ?6??m??
420+
421+
Encoded Decrypted Message =
422+
-----BEGIN PGP MESSAGE-----
423+
Version: PGPy v0.4.1
424+
425+
yzN1B21zZy50eHRY1UWaU2VjcmV0IG1lc3NhZ2UgdGhhdCBJIHdhbnQgdG8gZW5j
426+
cnlwdCHTFLG2vRg/NpEq6mdRA8E2sALVbZzA
427+
=Lqt2
428+
-----END PGP MESSAGE-----
429+
```
430+
431+
If decryption is successful the ASCII armored version of the message will be displayed. If decryption fails the message "Error with RSA decryption" will be displayed.
432+
433+
### Sign text email message using OnlyKey
434+
435+
If you using a previously set RSA private key with signing capabilities you can sign text messages in OpenPGP/GPG format:
436+
437+
```
438+
$ PGP_message.py
439+
```
440+
441+
`Do you want to sign or decrypt a message?`
442+
`s = sign, d = decrypt`
443+
```
444+
s
445+
446+
Enter RSA key slot number to use (1 - 4) or enter 0 to list key labels
447+
448+
1
449+
You should see your OnlyKey blink 3 times
450+
451+
Trying to read the public RSA N part 1...
452+
453+
Key Size = 512
454+
455+
Do you want to sign a text message or add signature to a PGP Message?
456+
t = text message, p = PGP Message
457+
458+
t
459+
460+
Type or paste the text message, press return to go to new line, and then press Ctrl+D or Ctrl+Z (Windows only)
461+
462+
this message is from me!
463+
464+
You should see your OnlyKey blink 3 times
465+
466+
Sending the payload to the OnlyKey...
467+
468+
Please enter the 3 digit challenge code on OnlyKey (and press ENTER if necessary)
469+
4 2 3
470+
471+
Trying to read the signature from OnlyKey
472+
For RSA with 4096 keysize this may take up to 9 seconds...
473+
474+
Encoded Signed Message =
475+
-----BEGIN PGP SIGNED MESSAGE-----
476+
Hash: SHA256
477+
478+
this message is from me!
479+
-----BEGIN PGP SIGNATURE-----
480+
Version: PGPy v0.4.1
481+
482+
wsFcBAABCAAGBQJY1UMbAAoJEFrjcMPEcl4WjCwP/0OMg9+Jll3b0r5l6Xbz/0uR
483+
ofW0NUC7jIcv/VJeGdF92aQrreeFcSLGJmQtOfDOIfxZUJ5fMq9jZapomEounVIy
484+
oEha/FWVGOyiK4OznSgBtkq2DUj3QQjp/tmQf7rAnYiliO6BOkTiJmib8CZaZTXx
485+
rbQEiLm7kUa4VFoYsum3qS6e2eICfZb/A45XMBjra0PhbZH8Et51IWCT52ighGP8
486+
LAE2s5U+2eLLXad/95QB3w9VaGtZmUvrEPb0vlOSeI6Wj/6aDde9+t1eZUAhsdwD
487+
AndKfCvoapGd3KV0JwkXg6OTr2U/cE5DHBpFYYHjeWmKcLs09v0O7BwcXSwY62UL
488+
0kddPiIxTU+AgPeK+A+xdsvZ6+j1ZZNZVMEG4RKFQnKignSSUR3AmkNQNAemzdBp
489+
Ki18Nl26zSuj5le+I5QjlGNJ8QSieXNGmbjlnj4GMNxCgM2XR6OmaK63oDkS/xp+
490+
ECd8yjzPWx5pDuYMEDKGvv8iw0kNe/b5ZYUTDhvZxlUeL5RtDzdAi2x4vVT8mbmu
491+
/lbnuy8A01geQEFsbMk+4ON9MktjvezYPbjNUGrhBxFqd2XKhIIwSueghdOym/Xr
492+
q6ZOiNRpqxG2aiRZ4flDn01qlYrtpGxLyQowxo4DVeBOTfPY0y+s7ni6KVadAFkd
493+
nHlZ6TZaI4Awu6b9tIAR
494+
=1llp
495+
-----END PGP SIGNATURE-----
496+
```
497+
498+
If signature is successful the ASCII armored version of the message will be displayed. If signature fails the message "Error with RSA signature" will be displayed.
499+
500+
### Add a signature to a PGP message using OnlyKey
501+
502+
If you using a previously set RSA private key with signing capabilities you can sign text messages in OpenPGP/GPG format:
503+
504+
```
505+
$ PGP_message.py
506+
```
507+
508+
`Do you want to sign or decrypt a message?`
509+
`s = sign, d = decrypt`
510+
```
511+
s
512+
513+
Enter RSA key slot number to use (1 - 4) or enter 0 to list key labels
514+
515+
1
516+
517+
You should see your OnlyKey blink 3 times
518+
519+
Key Size = 512
520+
521+
522+
Do you want to sign a text message or add signature to a PGP Message?
523+
t = text message, p = PGP Message
524+
525+
p
526+
527+
Paste OpenPGP Message, press return to go to new line, and then press Ctrl+D or Ctrl+Z (Windows only)
528+
529+
-----BEGIN PGP MESSAGE-----
530+
Version: PGPy v0.4.1
319531
532+
yzN1B21zZy50eHRY1UWaU2VjcmV0IG1lc3NhZ2UgdGhhdCBJIHdhbnQgdG8gZW5j
533+
cnlwdCHTFLG2vRg/NpEq6mdRA8E2sALVbZzA
534+
=Lqt2
535+
-----END PGP MESSAGE-----
536+
^D
537+
538+
You should see your OnlyKey blink 3 times
539+
540+
Please enter the 3 digit challenge code on OnlyKey (and press ENTER if necessary)
541+
3 2 4
542+
543+
Trying to read the signature from OnlyKey
544+
For RSA with 4096 keysize this may take up to 9 seconds...
545+
546+
Encoded Signed Message =
547+
-----BEGIN PGP MESSAGE-----
548+
Version: PGPy v0.4.1
549+
550+
yzN1B21zZy50eHRY1UWaU2VjcmV0IG1lc3NhZ2UgdGhhdCBJIHdhbnQgdG8gZW5j
551+
cnlwdCHTFLG2vRg/NpEq6mdRA8E2sALVbZzA
552+
=Lqt2
553+
-----END PGP MESSAGE-----
554+
-----BEGIN PGP MESSAGE-----
555+
Version: PGPy v0.4.1
556+
557+
xA0DAAgBX/X2Pr84qJgAyzN1B21zZy50eHRY1UWaU2VjcmV0IG1lc3NhZ2UgdGhh
558+
dCBJIHdhbnQgdG8gZW5jcnlwdCHTFLG2vRg/NpEq6mdRA8E2sALVbZzAwsFcBAAB
559+
CAAGBQJY1UciAAoJEF/19j6/OKiY67AQAKwEsTOvYr98S8QMxXoV1d3sUQDu0mCM
560+
7fASd10YR6YRHq2jcvy/D9+ZRc0dlZdUj+3GjbYbrxe10GeB0+EeJnCpaALLvfFm
561+
2+9XmM/w3KFHE2pAe+gvN8s2+hP8i7UWRRgcFQCSLvr+VP1yhfG0O7qdMnYgl6A7
562+
3TXPk4+PnH5qbuWiDDrl9XfdDw4wtFWOxRwq+GXM4hgLU4datouv3cmJA0ikY3Uw
563+
BIgxSP+Hv6ku94tOlACu0R4jOzq+jQBkgWkVViYlNCOS4EdaU9776wrhKIjRuibd
564+
yzerkZlMj91GrThC9Ox/sEbmoXpoa79Z8qXZi2wJ4AqNi4xnEUdtkGFgZaaJUsDn
565+
bbPlNLxictjcqFk9Q2LasbtAOT+f6yD4YgNqBV33fbZXVFiXgYdxqKb0BrcJBCQQ
566+
LcvrazK1byvdBCDiaoHatavaqKKjK9Fs3pCtm0jEfAaiSQStCMF4jRUGOxGWeRav
567+
kaCP7MvGtsNiR3kjDXO9Y79KNNn0ID/AZ9/Z9Ho1wSwUe95BG+WixaFcwz0KlDbZ
568+
bVV0mkPX7/orqD2ihVvmXXB9VcdXn6oKsNA2gBUQp4a80NnvGnh4bdtXoypZkNoe
569+
3bXNvRAne0kSPxjNzhBjJF9F1/EgjR0gHzi677AuhrRN1CkdaHLnnopBjkUmtU+0
570+
BNBU7972zW9q
571+
=9w/g
572+
-----END PGP MESSAGE-----
573+
```
574+
If signature is successful the ASCII armored version of the message will be displayed. If signature fails the message "Error with RSA signature" will be displayed.
575+
576+
## PGPMessage Support
577+
578+
Install w/PGPMessage support. Requires Python 2.7 and Git.
579+
580+
```
581+
$ git clone https://github.com/trustcrypto/python-onlykey.git --recursive
582+
$ cd python-onlykey
583+
$ pip2 install .
584+
$ cd PGPy
585+
$ pip2 install .
586+
$ cd ..
587+
```
588+
--->
320589
## Source
321590

322591
[Python OnlyKey on Github](https://github.com/trustcrypto/python-onlykey)

0 commit comments

Comments
 (0)