pecl-libsodium-doc
pecl-libsodium-doc copied to clipboard
Cookie Recipe Ingredients
I'm trying to understand how AEAD works. In the cookie recipe, why don't you use crypto_secretbox? From what I understand, it does the job:
We want to store data in a cookie such that user cannot read nor alter its contents.
Thanks
why don't you use crypto_secretbox?
No reason. You totally could.
All right, I started thinking that crypto_secretbox only provided encryption, not authentication. Obviously, I was wrong. Thanks for clarifying.