Re:Sqids – Generate Short Unique IDs from Numbers
by 8organicbits on Saturday November 25, 2023 @04:16PM
(#38416738)
It looks like an easy brute force too, there's no compute-hard operations here. I guess you could scramble your alphabet? Otherwise 1 => bM, 2 => Uk, etc.
[ Parent
| on HN ]
Re:Sqids – Generate Short Unique IDs from Numbers
by posix86 on Saturday November 25, 2023 @09:13PM
(#38418605)
My understanding is that you can re-order the source alphabet, and encode numbers with swapped characters. Unless you know of 36 numbers that they're exactly 1 id apart, you will always have uncertainty to what the ids actually map to.I guess given a large, large number of ids along with the order they're assigned (which might be given through the time at which they're assigned), you could create a pribabilistic statement on the actual order of the 36 characters based on the fact that most numbers increase/decrease faster the bigger they are. (this fact is e.g. used to detect fabricated bank statements - if the first digit of any number in the statement is equally likely to br 1 or 9, the numbers are randomly generated whereas if they're real, 9 is less likely than 1)
Re:Sqids – Generate Short Unique IDs from Numbers
by 8organicbits on Sunday November 26, 2023 @06:17AM
(#38420783)
Scambling the source alphabet should have an effect similar to a monoalphabetic substitution cypher. This is not strong cryptography. If the attacker has any ability to generate IDs quickly, like by creating user accounts or other resources they can create many IDs with known ordering. Likely effective against non-serious attempts.