this is code for encrypting files using c language.
//password encryption program for securing password
//pws v 1.0
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
//create this directory first D:\Sec_pw (OR as per your system drive names)
//file will be overwritten at each execution of program so use once
//increase array as per need
void main()
{
char buffer[72];
int i,x;
FILE *fp;
fp=fopen("D:\Sec_pw\sec.txt","w+");
clrscr();
printf("Enter code:");
scanf("%d",&x);
for(i=0;i<=71;i++)
{
scanf("%c",&buffer[i]);
//at the time of encryption use following statement
//else make it comment at the time of decryption/original
//copy text from D:\Sec_pw\sec.txt paste it
//make comment to following statement at the time of decrption
buffer[i]=buffer[i]-x;
}
printf("Encrypted text:");
for(i=0;i<=71;i++)
{
printf("%c",buffer[i]);
fprintf(fp,"%c",buffer[i]);
}
printf("\n");
printf("Decrypted text:");
for(i=0;i<=71;i++)
{
buffer[i]=buffer[i]+x;
printf("%c",buffer[i]);
}
getch();
}
Please help me to make it better. THX.