The SecretBox algorithm in pinenacl-dart is different from TweetNaCl and libsodium
Closed this issue · 4 comments
When encrypting a payload with a size of more than 16 KB using the same key and nonce, TweetNaCl (https://www.npmjs.com/package/tweetnacl) and libsodium (https://pub.dev/packages/sodium) generate exactly the same ciphertext (as expected).
But when trying the same with this library:
- the first 16 bytes are completely different
- the ciphertext until about 16 KB is correct (same output as TweetNaCl and libsodium)
- everything after 16 KB is different from TweetNaCl and libsodium
It would be great if the output of pinenacl-dart would be compatible the same algorithm in other crypto libraries, thanks!
Hi,
Can you pls provide some test vector to check?
Cheers,
Pal
Here you go: https://github.com/redsolver/pinenacl-bug-demo
There is the input file, the output files, the code and the diff command I used.
Thank you very much, it will be fixed soon.
I have found the root cause of the issue. It is some sign issues.
I meant it's fixed, but want to check other part of the package.
Thx.
Please use the latest package the v0.3.2 or v0.3.3
Cheers,
Pal