logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: 2320f305a8d26872b9d09f9e08007dda5fd72a97
parent 4b1d9341baba594303b3688ee9e59e6d75467547
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun, 18 Apr 2021 20:45:08 +0200

notes/computing-truths: Expand on Unique IDs

Diffstat:

Mnotes/computing-truths.txt10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/notes/computing-truths.txt b/notes/computing-truths.txt @@ -23,6 +23,16 @@ I would love to be proved wrong or shown doubts on any of this, thanks a lot if - Data decays eternally - You need threat models for your security - So called "Unique IDs" aren't always unique + - A lot of "Unique IDs" can be spoofed or badly generated/stored (quite common for MAC Addresses) + - In the case of UUIDs, they can be reasonably trusted but be careful on how you use them: + - "nil" UUID (entirely zero) is valid + - version 1 should be avoided in settings where time isn't linear (can easily jump backwards, always at the same date on boot, …) + - version 3 (MD5) and 5 (SHA-1) obviously shouldn't be used as security credentials + - version 4 is pure random and should be avoided when you have reliable time and can get a large sample size (Birthday problem) + - In decentralized settings consider FlakeIDs, 128-bits k-ordered IDs: 64-bits of milliseconds since UNIX epoch, 48-bits for the node-ID, 16-bits of random/sequence + Implementation: <https://git.pleroma.social/pleroma/elixir-libraries/flake_id> + Note on the node-ID: Consider generating a random ID at launch or installation; using another Unique ID like a MAC Address has uniqueness issues and privacy issues + It's also assumed that a node can reasonably assert if a FlakeID in it's own namespace was already used. ## Correctness - Asserting correction is hard (I do not believe that languages like F* actually do solve this entirely)