paragonie / pecl-libsodium-doc

Free Online Documentation for the Libsodium PHP Extension
https://paragonie.com/book/pecl-libsodium
Creative Commons Attribution 4.0 International
88 stars 11 forks source link

Cookie Recipe Ingredients #7

Open elipoultorak opened 8 years ago

elipoultorak commented 8 years ago

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

paragonie-scott commented 8 years ago

why don't you use crypto_secretbox?

No reason. You totally could.

elipoultorak commented 8 years ago

All right, I started thinking that crypto_secretbox only provided encryption, not authentication. Obviously, I was wrong. Thanks for clarifying.