Showing posts with label password in c++. Show all posts
Showing posts with label password in c++. Show all posts

Thursday, October 24, 2019

Password in C Using Turbo C

A simple password  program in C written using Turbo C by my friend and fellow software engineer Sir Ernel Fadriquilan.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.



My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.
 
 
 
Program Listing
 
 
//PASSWORD
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
char pswd[3],c;
int numchar=1;
void texter(char *s)
{
int i;
for(i=0;i<=strlen(s);i++)
{
printf("%c",s[i]);
delay(500);
}
}

void main()
{
clrscr();
while (numchar<=3)
{
c=getch();printf("*");
pswd[numchar]=c;
numchar++;
}
printf("\n");
texter("ernel");
gotoxy(5,5);texter("finals");
getch();
}

Tuesday, February 14, 2017

Password Security in C

Hi guys in this article I would like to share with you a sample program that I wrote that will ask the user to give a password and check if the given password is valid or not. What is good about this program it does not display the password while the user is type it instead it display the asterisk symbol in order to hide the real password to the user. The code is very simple and short I hope you will find my work useful.  I am using Dev C++ as my C++ compiler in this program. Thank you.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing


#include <stdio.h>
#include <string.h>
#include <conio.h>

int main()
{
    char buffer[256] = {0};
    char password[] = "admin";
    char c;
    int pos = 0;

    printf("\n==============================");
    printf("\nPassword Security in C");
    printf("\n==============================");
    printf("\n\n");

     printf("%s", "Give Your Password: ");
    do {
        c = getch();

        if( isprint(c) )
        {
            buffer[ pos++ ] = c;
            printf("%c", '*');
        }
        else if( c == 8 && pos )
        {
            buffer[ pos-- ] = '\0';
            printf("%s", "\b \b");
        }
    } while( c != 13 );

    if( !strcmp(buffer, password) )

    {
        printf("\n\n");
        printf("Password is Accepted.");
        printf("\n\n");
    }
    else
         {
        printf("\n\n");
        printf("Intruder has been detected.");
        printf("\n\n");
    }
        printf("\n\n");
        printf("THANK YOU FOR USING THIS PROGRAM");
        printf("\n\n");
}