Code: Show/Hide #include <iostream> #include <fstream> #include <stdio.h> using namespace std; #define ENCRYPTION_FORMULA (int) Byte + 29 #define DECRYPTION_FORMULA (int) Byte - 29 int Encrypt (char * FILENAME, char * NEW_FILENAME) { ifstream inFile; ofstream outFile; char Byte; inFile.open(FILENAME, ios::in | ios::binary); outFile.open(NEW_FILENAME, ios::out | ios::binary); while(!inFile.eof()) { char NewByte; Byte = inFile.get(); if (inFile.fail()) return 0; NewByte = ENCRYPTION_FORMULA; outFile.put(NewByte); } inFile.close(); outFile.close(); return 1; } int Decrypt (char * FILENAME, char * NEW_FILENAME) { ifstream inFile; ofstream outFile; char Byte; inFile.open(FILENAME, ios::in | ios::binary); outFile.open(NEW_FILENAME, ios::out | ios::binary); while(!inFile.eof()) { char NewByte; Byte = inFile.get(); if (inFile.fail()) return 0; NewByte = DECRYPTION_FORMULA; outFile.put(NewByte); } inFile.close(); outFile.close(); return 1; } int main() { char EncFile[200]; char NewEncFile[200]; char DecFile[200]; char NewDecFile[200]; int Choice; cout << "NOTE: Be sure to encrypt the file with the same file extension."<<endl; cout << "1. Encrypt\n2. Decrypt"<<endl; cin >> Choice; switch(Choice) { case 1: cout << "Enter the input Filename: "; cin >> EncFile; cout << "Enter the output Filename: "; cin >> NewEncFile; Encrypt(EncFile, NewEncFile); break; case 2: cout << "Enter the input Filename: "; cin >> DecFile; cout << "Enter the output Filename: "; cin >> NewDecFile; Decrypt(DecFile, NewDecFile); break; } return 0; } |
CypherJF wrote: |
I believe mr ekted coded up the profile password system- didn't he? |
Code: Show/Hide /* Continuum profile password encryption * * CommieCausey (commiecausey@gmail.com) * 7/10/06 */ #define PLAINTEXT_MAX 32 #define CYPHERTEXT_MAX 72 #include <string.h> long algo(long arg) { long eax, ecx; ecx = arg; eax = ecx << 5; eax -= ecx; eax = ecx + eax * 300 + 0xC091; return eax % 0x38F40; } void encPassword(const char *plaintext, char cyphertext[CYPHERTEXT_MAX+1]) { char padded[PLAINTEXT_MAX+1]; long eax, ebx=1, edx, ebp=0, key=0; int i, write=0; strcpy(padded, plaintext); for(i=strlen(padded); i<=PLAINTEXT_MAX; ++i) padded[i] = 0; for(i=0; i<PLAINTEXT_MAX; ++i) { eax = padded[i]; key ^= eax; ebp += eax * 91; ++eax; ebx *= eax; } key = (algo(ebx + key) << 16) | algo(ebx += ebp); for(i=0; i<0x64; ++i) { ebx = (algo(key >> 16) << 16) ^ algo(key); key = ebx; } /* start writing to string */ for(ebp=key, ebx=i=0; i<PLAINTEXT_MAX; ++i) { key = algo(key); eax = padded[i]; eax ^= (key & 0xFF); sprintf(cyphertext+write, "%02X", eax); write += 2; if(i == 6) { edx = ebp ^ 0x6A93C4F2; sprintf(cyphertext+write, "%08X", edx); write += 8; } } } |
CommieCausey wrote: |
I came back to check the topic and noticed he didn't want to decrypt them anyways oops! So I guess it is pretty harmless. C source code attached hope it helps you Doc.
Ok I get an error when I try to upload it so I will just copy/paste it is pretty short. |