Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   [HELP PLEASE] C Encryption (http://www.go4expert.com/forums/help-c-encryption-t8154/)

divinemanwah 8Jan2008 09:37

[HELP PLEASE] C Encryption
 
hello..
i made this simple program to encrypt a string to a file...
but i dont know how to decrypt it...
can anyone help?

Code:

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


main()
{
FILE *fp;
char enc[80];
int E[80], ctr, ctr2=0;

gotoxy(31,5); printf("Password Encryptor");
gotoxy(27,8); printf("Copyright WWW.ITSPOT.CO.NR");
getch();
clrscr();
gotoxy(5,3); printf("Enter the string to be encrypted: ");
gets(enc);

for(ctr=0;ctr<=strlen(enc);ctr++) {
        E[ctr2]=( (enc[ctr2]) - ( 0xFADA * enc[ctr2] ) ) /3;
        ctr2++;
}

fp = fopen("log\\pass.txt", "w+");



clrscr();
ctr2=0;
for(ctr=0;ctr<=strlen(enc);ctr++) {
        printf("%x",E[ctr2]);
        fprintf(fp, "%x", E[ctr2]);
        ctr2++;
}
gotoxy(5,3); printf("SUCCESS!! That's it...");

fclose(fp);
getch();

}



All times are GMT +5.5. The time now is 07:08.