samedi 17 juin 2017

C++: Portable alternative to CryptGenRandom

On every startup of an application, a random message of 128bits should be created such that the message has not been chosen before with maximum probability and this should also be secure (i.e. cannot be broken by some hacks). For example using a standard random generator with a seed taken from the system time is not secure because it can be broken by freezing the system time somehow (is this possible anyhow?).

The Windows function CryptGenRandom seems to be appropriate for this. But is there a portable alternative? If not, are there corresponding functions for Linux and Mac?




Aucun commentaire:

Enregistrer un commentaire