I was wondering if it would be possible to use Yubikey as a (hardware) true random number generator (TRNG). I guess the question is more about how to access the Yubikey's internal rng for real-time data reading. Something akin to /dev/urandom
.
Disclaimer: I'm not planning to use it in any real-world cryptographic applications -- it's just out of pure curiosity. My machine's /dev/urandom
has a decent level of entropy, and this is what I'm using for serious stuff.
One thing that might be useful is that you can just write to /dev/random
. It won't increase the amount of entropy (there are ways to do that but if you're doing that you really should be using a proper hardware TRNG).
Anyway, I'm mainly looking for suggestions on how to access the Yubikey's internal RNG and if anyone has done anything similar.
Edit: Upon further research, it seems that the Yubikey does have a built-in TRNG, and you can use the yubioathpersonalize
command to read the random numbers from it. However, this command seems to be used for a different purpose (personalizing the Yubikey for use with OpenPGP), and I'm not sure if it's the right tool for the job.
Does anyone know a better way to access the Yubikey's internal TRNG?