I was given task to generate random 80 byte keys and i have decided following strateges
in my computer sizeof(char)=1 so i have created array of english alphabetical letters
char *p=" ";
char a[0..26] and in cycle
for (int i=0;i<=80;i++){
*(p+i)+= a[(rand()+100) % 26];
}
but it does not work it stops execution please help sorry if my code is stupid but i can’t think at this time otherwise
thanks
code
#include <iostream>
#include <string.h>
#include <cstdlib>
using namespace std;
int main(){
char *p=" ";
char a[]= { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
for (int i=0;i<=80;i++){
*(p+i)+=(a[(rand()+100)%26]);
}
cout<<p<<endl;
return 0;
}
Try this out: