Header Ads Widget

Responsive Advertisement

Salting A Password Using String.

 



#include<stdio.h>
#include <string.h>
int main()
{
    char password[100];
    char salt[]= "@123";
    char newpassword[200];
    printf("Enter A Password (Without Space) : ");
    scanf("%s", password); // This can be written as : gets(password);
    strcpy(newpassword, password); //This Library Function is Used for copy password in newpassword.
    strcat(newpassword,salt); //This Library Function is Used for add salt with newpassword.
    printf("\nThe Salting Password is : ", newpassword);
    puts(newpassword); //This Library Function is Used for Print The value of newpassword in above line.

    return 0;
}


Post a Comment

0 Comments