-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyage fails to decrypt one of the official AGE test vectors #13
Comments
I found the payload is not valid. I examined the test vector using a hex editor and I found the bytes of the payload should be from age.file import Decryptor as ageStreamDecrypt
from age.keys.agekey import AgePrivateKey
from io import BytesIO
# official AGE test vector
# https://github.com/C2SP/CCTV/blob/3ec4d716e80597545ed285cf62af3dded3a14f65/age/testdata/x25519
expected_payload = '013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab'
file_key = '59454c4c4f57205355424d4152494e45'
identity = 'AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6'
age_payload = 'age-encryption.org/v1\n-> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc\nEmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U\n--- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0\n'.encode('utf-8') + bytes.fromhex('eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66')
keys = [AgePrivateKey.from_private_string(identity)]
buffer_in = BytesIO()
buffer_in.write(age_payload)
buffer_in.seek(0)
# prepare the output buffer and decrypt
buffer_out = BytesIO()
with ageStreamDecrypt(keys, buffer_in) as decryptor:
buffer_out.write(decryptor.read())
# return the content of the output buffer
buffer_out.seek(0)
decrypted = buffer_out.read()
print()
print('decrypted payload is')
print(decrypted) HMAC verification is passing and decrypted payload is
I will probably ask if the testvector is correct, probably just |
Ok nevermind, I found Thanks for great lib! |
Hello! I was playing with your library and found a problem. Not sure if I am using it incorrectly or if there is a bug.
fails with
the test vector is
ref https://github.com/C2SP/CCTV/blob/3ec4d716e80597545ed285cf62af3dded3a14f65/age/testdata/x25519
many thanks in advance for your comments!
The text was updated successfully, but these errors were encountered: