Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Security Password Policy.

Similar presentations


Presentation on theme: "Computer Security Password Policy."— Presentation transcript:

1 Computer Security Password Policy

2 Recommendations Easy to be remembered Difficult to guess
Sufficient length Not shown on the screen Renewable Use strong password The following is a simple program in c that ask user to enter password and match it.

3 Password Code in C language
#include <stdio.h> #include <string.h> #include <conio.h> int main() //main function { char buffer[12] = {0}; char password[] = "password"; char c; int pos = 0; printf("%s", "Enter password: "); Including C libraries Defining empty buffer Defining password variable Defining character variable Defining index for array Printing a text on screen

4 Password Code in C language(cont)
do { // a loop for interring the password c = getch(); // getch inputs invisible character if( isprint(c) ) { // tests if character is printable buffer[ pos++ ] = c; //put the character in the buffer //after incrementing the index by 1 printf("%c", '*');} //print (*) in the place of character else if( pos==12){ buffer[ pos-- ] = '\0'; } } while( c != 13 ); //13 is the Unicode number of “Enter” Not to go outside the buffer

5 Password Code in C language(cont)
if( !strcmp(buffer, password) ) //checking whether //password is correct printf("\n%s\n", "Logged on succesfully!"); else printf("\n%s\n", "Incorrect login!"); C=getchar(); Clrscr(); return 0; } Screen messages

6 End


Download ppt "Computer Security Password Policy."

Similar presentations


Ads by Google