3 ms·
It seems to me that this is (albeit in a somewhat convoluted way), "solving" one problem but opening a whole can of (cryptographic) worms on another. Namely th
by traceroute66 4y ago
It seems to me that this is (albeit in a somewhat convoluted way), "solving" one problem but opening a whole can of (cryptographic) worms on another.
Namely the biggest chestnut being the old classic of performing decryption on untrusted data. Since basic AES-128 is not an AEAD cipher, you are basically in the realms of trusting untrusted input.
Personally my preference would be to maintain UUID (or possibly KSUID-type implementations depending on application). And then if you need to partition/shard/whatever you do that by some other means (i.e. by or in conjunction with a different database column).
- aaaaaaaaaaab 4y agoWhat’s the threat model exactly? Here AES is just a bijection between 128bit numbers. It’s not like the AES cipher is going to blow up when you try to decrypt a special harmful bit pattern! It’s just a bunch of ones and zeros… If someone gives you a bogus ID, then it’s gonna decrypt to a non-existent ID. Which can also happen with plaintext IDs…