Search code examples
linux.net-coreentropyrngcryptoserviceprovider

RNGCryptoServiceProvider take from /dev/random


When executing from Linux, is it possible to have RNGCryptoServiceProvider read from /dev/random pool? This is a requirement given to me. I am new to this and I have tried looking this up; not able to find any information on this sorry.


Solution

  • No, you cannot change that class (which doesn’t actually use Windows CAPI on Linux, despite the name) to use the blocking random pool (short of building .NET Core yourself and changing how the class works).

    There are no knobs and switches to do what you want. If you want to read from /dev/random you can just open it as a file...