I am new to openssl library and from what I could understand it is possible to generate large primes say 512 bit using the command line argument :openssl prime -generate -bits 512
.
But I am not sure how can I do this using a C code?
I tried using system()
command to generate prime using following code:
int main()
{
char c[50];
strcpy(c, "openssl prime -generate -bits 512");
long long p = system(c); // IS THIS POSSIBLE??
return 0;
}
But I have read there are some security concerns on this as given in this link here
So is it possible to write this large prime generated in a text file or something so that I can use it later in my code.
My final motive is to generate two large prime numbers of order 512 bits.