[onerng talk] OneRNG for Windows
Paul Campbell
paul at taniwha.com
Thu Apr 9 00:02:07 BST 2015
On Thu, 09 Apr 2015 10:43:10 AyrA wrote:
> I started a C# Project (.NET 2.0) to simplify OneRNG usage on Windows.
>
> Since Windows lacks a global random device, I have written this application
> to serve as said device.
>
> Project: https://github.com/AyrA/WinOneRNG
great!
There is a windows kernel API for providing entropy we just haven't found
anyone with the knowledge to do the work - docs are here
http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1328.pdf
I wrote the following code skeleton as an (untested) start to a daemon to copy
onerng entropy into windows
Paul
main(int argc, char **argv)
{
ENTROPY_SOURCE_HANDLE h;
unsigned char buff[256];
int fd = open(argv[1], O_RDWR); // get the name of the OneRNG device
//from some plug script
// do something to turn off echo/etc
write(fd, "cmd0", 4);
write(fd, "cmdO", 4);
EntropyRegisterSource(&h, some-type-value, "OneRNG");
for (;;) {
l = read(fd, buff, sizeof(buff));
if (l < 0)
break;
EntropyProvideData(h, &buff[0], l, l*75/80); // assuming
7.5bits/byte
}
EntropyUnregisterSource(h);
exit(0);
}
More information about the Discuss
mailing list