i want 128 bit key in my academic project. Can any one please tell me how to generate 128 bit key in c++.
newbie1234 -2 Newbie Poster
Recommended Answers
Jump to PostUse 2 64 bit numbers in a class. What do you want to generate the key from?
Jump to Post#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.
All 6 Replies
Banfa 597 Posting Pro Featured Poster
newbie1234 -2 Newbie Poster
Banfa 597 Posting Pro Featured Poster
newbie1234 -2 Newbie Poster
Banfa 597 Posting Pro Featured Poster
Software guy 6 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.