Samuel
@samuel.fm
the bloom filter mind virus claims another victim
11 5 178
David Buchanan
I already have code to generate the dual-fnv-1a collisions that would be required to disappear a post of my choice, assuming I can get my "tainted" post viewed first
2 24
David Buchanan
const good = "https://bsky.app/profile/samuel.bsky.team/post/3ldjv73zdqk2g"; const evil = "https://bsky.app/profile/retr0.id/post/3ieuudbl4qj7d"; (fnv_1a(good) === fnv_1a(evil)) && (fnv_1a(good, 1576284489) === fnv_1a(evil, 1576284489)) (yeah I did http not at:// URIs because I was lazy lol)
2 13
David Buchanan
now that I'm looking at this again with my current knowledge I'm pretty sure I could make it go way faster... I basically treat a||b as a 64-bit hash and do a meet-in-the-middle with a big LUT. but I think I could write a solver for one of the halves, then meet-in-the-middle on the other half,
1 8
David Buchanan
fnv1a is faster, and even if you use a cryptographically secure hash, finding collisions is still trivial for a fixed bloom filter size
2 3
Natanael, Tech janitor
The reason Mozilla's CRLite works is because the targets/matched entries are not open ended + it uses 3 layers of bloom filters in opposite directions (inclusion / exclusion / inclusion), so errors are strictly controlled Collision resistance is necessary for stuff like this
1
Limi Lumen
I just wish Crypto.subtle had a bit wider choice of algorithms, "widely" used stuff like (X)ChaCha20(Poly1305) or BLAKE2(b) are missing even SHA-3 is missing. And I wonder if Kyber and Dilithium will ever be added even if they widely become adopted.
1 1
Limi Lumen
To be fair (X)ChaCha20(Poly1305) and BLAKE2(b) are all reasonable safe+fast in WASM AFIK and it's probably more sustainable to make sure WASM has the right extensions to allow secure implementations of modern ciphers then adding a ton of crypto you need to maintain forever.
1
Martin Kleppmann
Ha! The false probability rate was much worse before my fix, but looks like I screwed up the fix. Basically nobody knows how to implement the "k independent hash functions" bit of Bloom filters 😂
6
1 more reply
David Buchanan
It's less noticeable in this version because you'll still get multiple indices being generated, but they'll be the *same* indices as any other instance where hashA%size collides.
1 1
Ryan Moulton
I think it would be better to explicitly decay posts with time, perhaps adding the frequency with which you check discover to the decay. Reddit's mechanism was posted_time + log(upvotes) to model exponential decay in time without having to recompute every score when time advances.
1 9
Ryan Moulton
You could modulate the time vs activity contribution with a coefficient that depends on how often the user checks.
1 2
dan
basically if you’re walking around the app, Discover doesn’t know about it, so it currently may show you stuff you’ve already seen
1 9
Ryan Moulton
Yes, if the main point is to dedupe discover against other feeds, that makes sense. My thinking from the description was that the main issue was a lack of freshness in the discover feed itself, that people who check it frequently weren't seeing new things.
1 4
b5
I'm so torn on this one. Bloom filters in distributed systems, yes, very tough to use correctly, often a terrible idea over the wire, sizing is just straight up hard to get right. And then you pop the hood on any mature database...
1
Samson Sliteye
sorry, what does it do? it prevents me from seeing the same post several times if it gets shared by several people i follow?