by savannahkc on 1/10/25, 2:01 PM with 103 comments
by stitched2gethr on 1/10/25, 2:41 PM
by lovasoa on 1/10/25, 2:34 PM
by theamk on 1/10/25, 2:12 PM
IMHO this makes key much more beautiful than any internal structure.
by anticorporate on 1/10/25, 2:25 PM
by remram on 1/10/25, 2:45 PM
I bring this up a lot [2] but I do think there is value in being able to tell if something is a secret and tell where to go to revoke it if found. Most current API keys use some sort of prefix at least (AWS, SendGrid, GitHub, etc).
[1]: https://docs.github.com/en/code-security/secret-scanning/int...
by PaulHoule on 1/10/25, 2:23 PM
I used T.U.M. for a number of sites including one that was in the Alexa top 2000, even though it was open source it got no pickup from anyone else. The standard at the time was to pick up some software like PHPNuke which did a lot of things badly as opposed to my Yahoo-inspired approach of "pick the best of breed software and plug them into a common user management system".
The idea didn't get any traction until 2013 when things like this popped up like mushrooms. Seemed the missing features were "vendor lock-in", "somebody else owns your user database", "they might shut down, get bought by Google or kick you out of the free tier."
[1] I've seen it enough that I'd expect higher uptake if you inject small flaws into a specification like that.
by philo23 on 1/10/25, 2:39 PM
by fusspawn on 1/10/25, 2:46 PM
its an alphanumeric random string in both systems.
yes theres is kinda symetrical. but im not going to find it easier to communicate/remember say:
38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X
any easier than i am
d1756360-5da0-40df-9926-a76abff5601d
both are long random strings. both are awkward to have to read over say a phone call.
what am I missing here?
by mtmail on 1/10/25, 2:20 PM
Example: "d1756360-5da0-40df-9926-a76abff5601d" => "38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X"
I think now you risk having 0 vs O or I vs 1 readability issues. [edit: good news, I was wrong]
by a12k on 1/10/25, 2:42 PM
by progbits on 1/10/25, 2:41 PM
See for example: https://docs.github.com/en/code-security/secret-scanning/sec...
by savannahkc on 1/11/25, 9:04 PM
0. Some folks don't care about API Keys, that's okay! But for those of you who did respond and do care, we are updating our design based on your feedback.
1. When we got to work on making our API Keys, we looked for an obvious standard but didn't find one. So we decided on our approach quickly and put together uuidkey in an afternoon. We knew it was not going to be everyone’s preferred design, but we wrote up the article to share our thought process as well as generate some marketing. We are happy to see that the article did well and we got feedback! :)
2. The ability to double-click to copy, which was lost with the addition of dashes, was more important to developer commenters than we thought it'd be (even if only needed once). We heard you, so we've already updated https://github.com/agentstation/uuidkey to support a `WithoutHyphens` option for the `Encode` function so you can generate keys without dashes.
3. Some folks were worried that our resulting key after encoding has fewer bits of entropy compared to the original UUID. The Crockford base32 encoding does not reduce entropy, it is a 1:1 mapping.
4. One quality piece of feedback pointed out that the UUID spec warns against using UUIDv7 (only 74 bits of entropy) and even UUIDv4 (standard 122 bits of entropy) alone for API Keys. We plan on still supporting UUIDv7 and UUIDv4, but will add additional entropy bits to follow the official recommendation.
4. Lots of commenters like prefixes, which make it easier to identify & search for keys (particularly to ensure they don’t get accidentally committed to a repo). We plan to add an option for that. Worth mentioning that a few folks pointed us to Github's auth token implementation that includes prefixes, which is a pretty great standard - https://github.blog/engineering/platform-security/behind-git...
Thanks again for reading, debating, and giving us some good advice! We want a product that feels good for developers to use. :D
by smashed on 1/10/25, 2:52 PM
Aren't you going to track the keys in a database, where you can keep the tenant id and creation time, scope of the key and any other significant metadata anyway?
A static prefix + checksum, maybe a version number so you can future-proof the system sounds like best practice. For example `ASKEY1-(128bit random base32 encoded)-(chksum)`.
by voidUpdate on 1/10/25, 2:28 PM
by tzury on 1/10/25, 2:53 PM
1. API keys are security credentials: - They are meant to be secret and revocable - They often encode metadata about permissions and identity - Compromised API keys must be invalidated and replaced - They function like passwords for authentication/authorization
2. UUIDs are identifiers: - They are designed to be globally unique but not secret - They contain no inherent permissions or privileges - There's no security risk if others know a UUID - They function like serial numbers for identification
To use an analogy: An API key is like the key to your house (needs to be kept secret, grants access, can be changed if compromised), while a UUID is like your house's street address (can be public, just identifies the location, doesn't grant any access by itself).
Thinking they're equivalent is like saying your house key and address are the same thing just because they're both strings of characters. This misconception could lead to serious security vulnerabilities if API keys are treated with the same casualness as UUIDs.
PS, we all liked this site, right? https://everyuuid.com/
by pksunkara on 1/10/25, 3:02 PM
Disclaimer: I built it.
by gioazzi on 1/10/25, 2:46 PM
I try to make it obvious in UI by automatically converting to uppercase, replacing O->0 etc, and adding a dash in the middle.
by error404x on 1/10/25, 2:34 PM
I usually create an API key like this: `sk_${randomUUID().replace(/-/g, '')}`.
by xdennis on 1/10/25, 3:24 PM
I'm not sure if this is meant to be read as "uppercase (letters and numbers)", but it is effectively what he's referring to.
Lowercase digits do exist[1], but there's no Unicode encoding for them and fonts typically have to choose to support one or the other.
by cynicalsecurity on 1/10/25, 3:11 PM
by bArray on 1/10/25, 2:54 PM
Or, just ignore the dashes? It's not that difficult, we have the technology.
by realaleris149 on 1/10/25, 8:33 PM
by seveibar on 1/10/25, 9:07 PM
by bkummel on 1/10/25, 3:28 PM
by balls187 on 1/10/25, 3:12 PM
by alt227 on 1/10/25, 3:24 PM
I have never ever heard a developer even mention the way api keys look before.
by skerit on 1/10/25, 3:18 PM
by benterix on 1/10/25, 3:02 PM
by robertclaus on 1/10/25, 2:29 PM