la password deve essere generata random con upperCase,lowercase,num e symbol
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int myMenu();
void genPassword();
void verPassword();
void randNum();
void main()
{
char upperCase[] = { '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' };
char lowercase[] = {'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'};
int num[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};
char symbol[] = {'!', '£', '$', '€', '%', '^', '&', '*', '(', ')', '@', '#', '<', '>', '?', '+', '=', '-'};
int passwordLength;
int iMenu;
char r;
do
{
iMenu = myMenu();
switch(iMenu)
{
case 1:
{
genPassword();
break;
}
case 2:
{
verPassword();
break;
}
case 3:
{
printf("\nGoodbye"
;
break;
}
default:
{
printf("\nSeleziona una scelta"
;
break;
}
}
}while(iMenu != 3);
printf("\n\n"
;
system("pause"
;
}
int myMenu()
{
int myChoice;
system("cls"
;
printf("\n Benvenuto"
;
printf("\n 1. Genera Password"
;
printf("\n 2. VerificaPassword"
;
printf("\n 3. Esci"
;
printf("\n\n Inserisci una scelta: "
;
fflush(stdin);
scanf("%d", &myChoice);
return(myChoice);
}
void randNum()
{
char r;
srand(time(NULL));
r = rand();
}
void genPassword()
{
printf("Password generator \t"
;
printf("\n\n"
;
system("pause"
;
}
void verPassword()
{
printf("Password verifica \n"
;
printf("\n\n"
;
system("pause"
;
}