Hey. I have been playing with AGE and using your comprehensive test vectors to try my code.
I tried this one
|
expect: success |
|
payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab |
|
file key: 59454c4c4f57205355424d4152494e45 |
|
identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 |
|
|
|
age-encryption.org/v1 |
|
-> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc |
|
EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U |
|
--- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 |
|
îÏbÇΑ´3'NhÔòù�L·L[þ÷¾ªRÈð¼�™,�ƒ1ûf |
I had difficulties decrypting it using pyage
library, HMAC verification and file key were reproduced but there was just payload problem. Details here jojonas/pyage#13 (comment)
I downloaded the file and investigated it using a hex editor. Copying the encrypted payload otherwise leads to tag issues, probably because github and other file browsers attempt to decode the binary payload.
I find the hex encoded payload to be decryptable it has to be
eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66
so the 16 byte nonce is eecf62c7ce91b433274e68d4f2f9134c
and ciphertext is b74c5bfef7beaa52c8f0bc0e992c1e8331fb66
. This is not at all equal to
|
payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab |
if I attempt to decrypt 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab
I find the tag is invalid. However if I decrypt eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66
I get valid tag and decrypted payload is age
string (three bytes 616765
hex encoded).
I assume this is correct because of
|
func main() { |
|
f := testkit.NewTestFile() |
|
f.VersionLine("v1") |
|
f.X25519(testkit.TestX25519Recipient) |
|
f.HMAC() |
|
f.Payload("age") |
|
f.Generate() |
|
} |
could you double check this test vector and see if the payload 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab
shouldn't be replaced by eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66
?
The code that decrypts the payload and gives age
plaintext is available here jojonas/pyage#13 (comment)