vendredi 15 février 2019

how can I improve my code to generate secure random numbers?

I am trying to found out what is the best way or library to generate secure random numbers such as secrets in python.

I am working on windows 10 using codeblocks. I have done this so far:

#include <cstdlib> 
#include <ctime> 
#include <iostream>

using namespace std;

int main() 
{ 
    srand((unsigned)time(0)); 
    int i;
    i = (rand()%6)+1; 
    cout << i << "\n"; 
}

I am trying to replicate the same function as secrets from python to generate secure random numbers.




Aucun commentaire:

Enregistrer un commentaire