Skip to content

Commit 51045d7

Browse files
committed
updated to pynacl
1 parent 2933e59 commit 51045d7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

main.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
from cryptography.hazmat.primitives import hashes
33
from cryptography.hazmat.backends import default_backend
44
from cryptography.exceptions import InvalidKey, InvalidTag
5-
from ed25519 import BadSignatureError
5+
6+
7+
from nacl.signing import VerifyKey
8+
from nacl.exceptions import BadSignatureError
9+
610
import argparse
7-
import ed25519
11+
#import ed25519
812
import base64
913
import json
1014
import sys
@@ -47,14 +51,13 @@
4751

4852
# Verify using Ed25519
4953
try:
50-
verify_key = ed25519.VerifyingKey(
51-
os.environ['KEYGEN_PUBLIC_KEY'].encode(),
52-
encoding='hex',
54+
verify_key = VerifyKey(
55+
bytes.fromhex(os.environ['KEYGEN_PUBLIC_KEY'])
5356
)
5457

5558
verify_key.verify(
56-
base64.b64decode(sig),
5759
('license/%s' % enc).encode(),
60+
base64.b64decode(sig),
5861
)
5962
except (AssertionError, BadSignatureError):
6063
print('[error] verification failed!')

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
argparse
22
cryptography
3-
ed25519
3+
#ed25519
4+
pynacl

0 commit comments

Comments
 (0)