Hi,
I have a snippet that encrypts/decrypts using RSA.
#include <stdio.h>
#include <openssl/rsa.h>
#include <string.h>
// RSATest: Program illustrating Simple RSA Encryption/Decryption
int main()
{
char *plain="Sample text"; //Sample text (plain text) to Encrypt/Decrypt
char *ciphertext;
char *plain1;
int enclen,i,declen;
printf("%s\n",plain);
// Generate RSA key
RSA *rsa1= RSA_generate_key(1024,65537,NULL,NULL);
// RSA_size() will determine how much memory must be allocated for an RSA encrypted value
ciphertext = (char *)malloc(RSA_size(rsa1));
printf("RSA size %d",RSA_size(rsa1));
I am using Cygwin. My question is this....Where and How do I seed the random number generator?
Thanks,
Joe
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!