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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why access and API tokens are the new passwords but worse

20 点作者 akane超过 6 年前

4 条评论

Cpoll超过 6 年前
&gt; On top of that, passwords are at least hashed in the database and salted. And most frameworks promote this good behaviour nowadays and have extensive documentation on how to do this. But for API tokens we’re outta luck. We need them in their current plaint-text form to communicate with the API’s so all we can do is encrypt them at rest and decrypt them when necessary. Alas for many this practice is not widely communicated nor documented.<p>Half the reason to hash and salt is to prevent an attacker from obtaining the plaintext (often reused) password, which doesn&#x27;t apply for API keys.<p>With that said, there&#x27;s no reason why a service couldn&#x27;t send you a plaintext API key but only store the hashed and salted key in their database. I suspect AWS, for example, does just that (you can&#x27;t obtain your API secret except right after generating it). The API consumer needs a way to store&#x2F;decrypt the plaintext API key, but that also applies to passwords.
评论 #18917013 未加载
toyg超过 6 年前
Poor post (not even spellchecked) about an actual but well-known problem.
Arzh超过 6 年前
This might be one of the worst things I&#x27;ve read this week. Tokens shouldn&#x27;t have anything to do with your login and giving out login is so much worse.
评论 #18918669 未加载
PaulHoule超过 6 年前
That call to action at the bottom is awful.