lightning-kmp icon indicating copy to clipboard operation
lightning-kmp copied to clipboard

Add secondary pseudo-random number generator

Open t-bast opened this issue 3 years ago • 0 comments

In case of catastrophic failures of the OS SecureRandom instance, we add a secondary randomness source that we mix into the random stream.

This is a somewhat weak random source and should not be used on its own, but it doesn't hurt to xor it with the output of SecureRandom.

The runtimeEntropy should be customized for iOS and Android by fetching all kind of random noise available to the application (available memory, process ID, sensor data, network statistics, etc).

Thanks @robbiehanson for the iOS code!

t-bast avatar Apr 21 '21 17:04 t-bast