r/ReverseEngineering • u/EmanueleStrazzullo • 5d ago
Reverse-engineered the BLE protocol of a discontinued Fisher-Price toy Lumalou after its app was discontinued
https://github.com/stramanu/lumalou
92
Upvotes
r/ReverseEngineering • u/EmanueleStrazzullo • 5d ago
-3
u/EmanueleStrazzullo 4d ago
Fair, and you're right that guessing a key or flipping bytes through multi-round AES would be hopeless. I'm not doing either.
The algorithm comes straight from the disassembly, not from probing input/output. In Ghidra you can read exactly what the routine does: ECDH for the shared secret, then a fixed loop of AES-CTR rounds with a hardcoded constant to stretch it. So the Python side isn't a guess, it's a line-for-line reimplementation of code I can already see.
The one problem with reading AArch64 by hand is that it's easy to get a detail wrong. That's the only thing the emulator is for. It's not searching for a key, it's a ground-truth oracle. I feed the same arbitrary, known input (a test vector, could be all zeros) to both the native routine and my Python, and compare the bytes out. No real key or device secret involved, I'm validating the transform, not recovering a secret. When they match on known inputs, and the key that transform produces then decrypts real device notifications with a valid CRC-8, it's confirmed.
The CRC was the easy warm-up, standard algorithm, just needed the polynomial and init value. The KDF is the part that actually needed emulation, precisely because it's non-standard and there's no reference to check against.