1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[HELP PLEASE] C Encryption

Discussion in 'C' started by divinemanwah, Jan 11, 2008.

Thread Status:
Not open for further replies.
  1. divinemanwah

    divinemanwah New Member

    Joined:
    Jan 8, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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();
    
    }
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page