Skip to content

Commit 3ae6903

Browse files
committed
replace legacy ed25519 with pynacl
1 parent 61afe24 commit 3ae6903

11 files changed

Lines changed: 94 additions & 114 deletions

File tree

App/MacOS/PGP_message

-5.93 MB
Binary file not shown.

App/MacOS/PGP_message.app/Contents/Info.plist

Lines changed: 0 additions & 23 deletions
This file was deleted.
-5.93 MB
Binary file not shown.
-108 KB
Binary file not shown.

App/MacOS/cli

-3.66 MB
Binary file not shown.

App/MacOS/cli.app/Contents/Info.plist

Lines changed: 0 additions & 23 deletions
This file was deleted.
-3.66 MB
Binary file not shown.
-108 KB
Binary file not shown.

onlykey/cli.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from prompt_toolkit.key_binding import KeyBindings
1818
from prompt_toolkit.keys import Keys
1919
from prompt_toolkit.filters import Condition
20-
import ed25519
20+
import nacl.signing
2121

2222
from .client import OnlyKey, Message, MessageField
2323

@@ -56,10 +56,10 @@ def prompt_pin():
5656

5757
# Create a new private key
5858
if sys.argv[2] == 'new':
59-
signing_key, _ = ed25519.create_keypair()
59+
signing_key, _ = nacl.signing.SigningKey.generate()
6060

6161
with open('ecc_private.key', 'wb+') as f:
62-
f.write(signing_key.to_seed())
62+
f.write(signing_key.encode(encoder=nacl.encoding.HexEncoder))
6363

6464
print('ECC private key written to ecc_private.key')
6565

@@ -307,7 +307,7 @@ def prompt_pin():
307307
else:
308308

309309
# Print help.
310-
print('OnlyKey CLI v1.1.0')
310+
print('OnlyKey CLI v1.2.0')
311311
print('Control-D to exit.')
312312
print()
313313

@@ -353,7 +353,7 @@ def mprompt():
353353
print(only_key.read_string() + ' for second profile')
354354
only_key.send_message(msg=msg)
355355
print(only_key.read_string())
356-
print
356+
print ()
357357
input('Press the Enter key once you are done')
358358
only_key.send_message(msg=msg)
359359
print(only_key.read_string())
@@ -567,6 +567,3 @@ def main():
567567
print()
568568
print('Bye!')
569569
pass
570-
571-
if __name__ == "__main__":
572-
main()

0 commit comments

Comments
 (0)