3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by Software guy
0

Use 2 64 bit numbers in a class. What do you want to generate the key from?

I used unsigned int a [4];

but is there any key generator is there. Which generate 128 bit no.

0

That is fine, but generate a 128 bit number from what? What is the source of the number you wish to generate or do you just want a random value?

Edited by Banfa: n/a

0

That is fine, but generate a 128 bit number from what? What is the source of the number you wish to generate or do you just want a random value?

yes any random value.

0

Well call rand() 4 times assigning the result of each call to your array of integers in sucession.

Edited by Banfa: n/a

0
#include <stdlib.h>
#include <iostream>
#include <time.h>
using namespace std;


int main()
{
  int x[4];
  int _key;
  srand ( time(NULL) );
  
  for(int i=0;i<4;i++)
  {
    x[i] = rand();
    
   }

   cout<<"The key is:"<<x[3]<<"-"<<x[2]<<"-"<<x[1]<<"-"<<x[0]<<endl;

  return 0;
}

if you want to customize it to characters you can.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.