Skip to content

Commit 59ac35d

Browse files
author
Blackeye
committed
updated to pynacl
1 parent 2933e59 commit 59ac35d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

main.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
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.encoding import HexEncoder
9+
from nacl.exceptions import BadSignatureError
10+
611
import argparse
7-
import ed25519
12+
#import ed25519
813
import base64
914
import json
1015
import sys
@@ -46,15 +51,16 @@
4651
sys.exit(1)
4752

4853
# Verify using Ed25519
54+
# exit()
4955
try:
50-
verify_key = ed25519.VerifyingKey(
51-
os.environ['KEYGEN_PUBLIC_KEY'].encode(),
52-
encoding='hex',
56+
verify_key = VerifyKey(
57+
bytes.fromhex(os.environ['KEYGEN_PUBLIC_KEY'])
5358
)
5459

60+
print("GETTING ALONG")
5561
verify_key.verify(
56-
base64.b64decode(sig),
5762
('license/%s' % enc).encode(),
63+
base64.b64decode(sig),
5864
)
5965
except (AssertionError, BadSignatureError):
6066
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)