by notfed · 3y ago · 0 comments
A secure "random-looking id generator" is called a block cipher. Block ciphers with less than 128 bits of output are widely considered insecure: this corresponds to about 22 base64 characters.
Going further, you probably do want to use a secure algorithm. History is full of people thinking "we don't need this to be secure, it's not used for security-sensitive things" and later regretting it. Some case studies at [1].
[1] https://www.schneier.com/blog/archives/2016/04/security_risk... .
https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Dire...
When I first joined $company, HR sent me a SharePoint document with a numerical ID. Incrementing or decrementing the ID allowed me to view personal information of other employees including their pay.
Personally I think it's stupid but this is a tempting solution.
But in the "Not good for" section it states the opposite: "[not good for] User IDs can be decoded, revealing user count" so it can be reversed?
>I appreciate that the author clearly states that security, (i.e., output can't be reversed back to the input), is a non-requirement.
My issue with Sqids is they're longer and more complicated than the input!