TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What the heck is AEAD again?

52 点作者 wofo13 天前

9 条评论

tptacek13 天前
Another AD example: Ben Toews, in our Vault replacement secret storage system Pet Semetary, uses the AD on SQLite ciphertexts to bind them to a particular row (and&#x2F;or a particular key path).<p>I wrote a local file encryption tool, around the same time Filippo was doing `age`, and used the AD on Chapoly to authenticate the chunk offset into the file. (The only thing interesting my tool did was that it could pull keys from AWS KMS).<p>So one use for AD is to authenticate headers; another is contextual binding.<p>If it helps (because &#x27;stavros asked across the thread why bother having AD at all rather than just including it in the ciphertext), authenticated data can include data that <i>doesn&#x27;t even appear in the message</i>, but rather is derived from the context at the time the message is encrypted and decrypted. A message only meant to be decrypted on a particular host (or whatever), for instance, could include the host in its AD, but never record that in the actual bits of the message.
评论 #43827947 未加载
peterldowns13 天前
If you&#x27;re interested in doing AEAD with the current best-practice algorithms in golang, you might get inspiration from my work-in-progress symcrypt package. I&#x27;m not a cryptographer and you shouldn&#x27;t trust me when I say it works correctly — but it&#x27;s basically just a small, correct, wrapper around the chacha20poly1305 code in the golang standard library. It has the slight advantage of using different types for the plaintext and the associated data (here called Owner, because I use it to store API keys owned by specific<p>If you squint at the example usage in the tests, it&#x27;s basically the API that the blogpost describes.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;peterldowns&#x2F;symcrypt&#x2F;blob&#x2F;main&#x2F;symcrypt_test.go">https:&#x2F;&#x2F;github.com&#x2F;peterldowns&#x2F;symcrypt&#x2F;blob&#x2F;main&#x2F;symcrypt_t...</a><p>As an aside, I&#x27;m always curious to understand why the encryption people say &quot;never roll your own crypto&quot; but then also ship confusing APIs without clear usage examples. For instance, check out the golang chacha20poly1305 docs:<p><a href="https:&#x2F;&#x2F;pkg.go.dev&#x2F;golang.org&#x2F;x&#x2F;crypto&#x2F;chacha20poly1305" rel="nofollow">https:&#x2F;&#x2F;pkg.go.dev&#x2F;golang.org&#x2F;x&#x2F;crypto&#x2F;chacha20poly1305</a>
评论 #43827355 未加载
评论 #43827851 未加载
stavros13 天前
Can someone explain what use the AD is, if we have to decrypt the message to authenticate the AD? If I&#x27;m decrypting the message already just to authenticate it, why wouldn&#x27;t I encrypt the AD as well?
评论 #43827408 未加载
评论 #43828538 未加载
senderista13 天前
I don&#x27;t understand the example. Presumably the server doesn&#x27;t have the user-owned encryption key. So how can the server &quot;detect that the user id has been tampered with&quot; if it doesn&#x27;t have the key necessary to authenticate the user id?
评论 #43827887 未加载
评论 #43828000 未加载
评论 #43827931 未加载
评论 #43828053 未加载
twic13 天前
Internally, is AEAD just using the &quot;usual&quot; ciphers, digests, and PRNGs, just making sure to combine them in the right way? If so, are all AEAD &quot;ciphers&quot; the same, just with different sub-primitives plugged in?
评论 #43827373 未加载
评论 #43828430 未加载
评论 #43828475 未加载
kazinator13 天前
The TL;DR of this seems to be: the plaintext metadata accompanying ciphertext (&quot;associated data&quot;) is mixed into the ciphertext&#x27;s encryption (essentially as an initial vector). Thereby, if the plain-text data is altered, the ciphertext cannot be correctly decrypted. The ciphertext is both a secret message, and a signature of the unencrypted data, so a separate HMAC is not required.<p>We can imagine, e.g. in the context of e-mail, if the DKIM header signature were combined a PGP-encrypted body as one operation. I&#x27;m ducking under the table now, though.
评论 #43828643 未加载
andrekandre13 天前
i really appreciate how this article was written<p>just the right length and pacing to get me to the end and the point across
评论 #43828134 未加载
dlenski12 天前
Look, it&#x27;s a great article, but <i>the perfect title</i> was right there.<p>&gt; What&#x27;s my AEAD again, what&#x27;s my AEAD again?
halosghost13 天前
See also: <a href="https:&#x2F;&#x2F;www.latacora.com&#x2F;blog&#x2F;2024&#x2F;07&#x2F;29&#x2F;crypto-right-answers-pq&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.latacora.com&#x2F;blog&#x2F;2024&#x2F;07&#x2F;29&#x2F;crypto-right-answer...</a><p>All the best,<p>-HG