Is there a C++11 CSPRNG?

前端 未结 1 1096
情歌与酒
情歌与酒 2021-02-08 15:02

As we know, the Mersenne Twister is not crytographically secure:

Mersenne Twister is not cryptographically secure. (MT is based on a linear recursion. A

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-08 15:39

    Visual Studio guarantees that random_device is cryptographically secure and non-deterministic: https://msdn.microsoft.com/en-us/library/bb982250.aspx

    If you want something faster or cross platform, you could for example use GnuTLS: http://gnutls.org/manual/html_node/Random-number-generation.html It provides random numbers of adjustable quality. GNUTLS_RND_RANDOM is what you want I think.

    As several people already said, please forget about MT in cryptographic contexts.

    0 讨论(0)
提交回复
热议问题