cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
448 stars 75 forks source link

Mix in external entropy sources #8

Closed stepansnigirev closed 3 years ago

stepansnigirev commented 5 years ago

At the moment rng module is only using TRNG by ST, we need to collect entropy from TRNG for longer time add mix in user entropy as well. To do that we can implement rng.feed(data) function that will be called when we got some random data.

Good possible sources of entropy:

Analog inputs could be another source, but all exposed analog pins are busy with the extension board.

stepansnigirev commented 4 years ago

https://github.com/cryptoadvance/specter-diy/commit/834ac0e6733e260e3c11184697a2d14596433020 added entropy from the touchscreen. Timestamp (cpu ticks) and coordinates of the touch are added to the entropy pool every time the screen is touched. It is done via @feed_rng decorator for littlevgl events.

stepansnigirev commented 3 years ago

With #90 user can add entropy, so we already have enough sources - TRNG, touches and clock cycles, and now user entropy. I will close it for now.