XOR Cracker

Posts 115 of 23 · Page 1 of 2
XOR Cracker
Many of you know I have made a XOR text encryptor, well this is the rival of that encryptor. This is a cracker that I developed to be able to crack XOR encryptions. It does so very easily by looking at small parts of the encrypted text file, so that a human eye can quickly look over the 200+ possible combinations.

Here is a screen shot of it in action:


You can see that in this case I was cracking the source code to my own encrypted file.

And the Console:


I'm planning to add some more features including add some more features that will search for strings of of maybe 3 or more letters and automatically filter the results.

Problems:
Lol I tried to use this to decrypt some of the encrypted text files CA uses. I think one of the problems might be that they are using wchar, or either that its a different type of encryption. So I will keep working on this. And see if I can atleast figure out the encryption since I can't help BA with the plugin for Paint.NET...

Finally the source code:
Code:
void XOR_char_crack(char* str)
{
     fstream file(str, ios::binary | ios::in | ios::out);
     fstream dump("dump.txt", ios::in | ios::out | ios::trunc);
     
     if(!file)
     {
      cout << "ERROR. Cannot open specified file. File must be in same directory as decryptor.\n";
      return;
     }
     if(!dump)
     {
      cout << "ERROR. Cannot open dump.txt file.\n";
      return;
     }
     
     char ch;
     char temp[20] = "";
     unsigned char k = 0;
     do
     {
      for(int i=0; str[i]; i++)
      {
              file.get(ch);
              temp[i] = (ch ^ k);
      }
      file.seekg(ios::beg);
      dump << "Key of: " << k << " Produces: " << temp << endl << endl;
      cout << "Key of: " << k << " Produces: " << temp << endl << endl;
      k++;
     }while(k != 0);
     
     return;
}
I have also included the full source. As this project becomes more advanced I will be more stringent about giving out the source for the cracking software since it sort of defeats the point of the encryption software. However if you want the full source just ask me for the key and I will PM it too you or MSN or whatever.
EncryptorSource.txtattachment deleted · 14 downloads before removal
Nice, so this decrypts the text from your encryptor?
Quote Originally Posted by That0n3Guy View Post
Nice, so this decrypts the text from your encryptor?
Pretty much, or any XOR encrypted ASCII txt file. Hmmm... I could post the Cracker, but it's not really done yet. I suppose I will post the entire source and the .exe when I finish tweaking it.
Brute force FTW lol At least it only needs to run 255 times before you have all possible outcomes

not to crush any hopes & dreams of cracking the CA txt files, but really X-OR 'encryption', let alone X-OR with 1 byte repetitively, while a fun school project, just isn't used in the real world.
Quote Originally Posted by B1ackAnge1 View Post
Brute force FTW lol At least it only needs to run 255 times before you have all possible outcomes

not to crush any hopes & dreams of cracking the CA txt files, but really X-OR 'encryption', let alone X-OR with 1 byte repetitively, while a fun school project, just isn't used in the real world.
Yeh. I know. I kind of figured this would be way out of my league, but I can atleast try a couple different techniques, maybe a bitwise rotation, or something else. And once all those will undoubtedly fail I will use the internet to use more common encryption techniques. I mean Nexon couldn't have put to much thought into encrypting simple text files right?
Quote Originally Posted by why06 View Post
Yeh. I know. I kind of figured this would be way out of my league, but I can atleast try a couple different techniques, maybe a bitwise rotation, or something else. And once all those will undoubtedly fail I will use the internet to use more common encryption techniques. I mean Nexon couldn't have put to much thought into encrypting simple text files right?
-cough- jinxed.
True - but that probably means they took whatever is readily available in windows and used that (DES/RSA or whatever else) instead of writing their own encryption scheme
Quote Originally Posted by B1ackAnge1 View Post
True - but that probably means they took whatever is readily available in windows and used that (DES/RSA or whatever else) instead of writing their own encryption scheme
Hmmm... good point.


I found DEA...
Code:
void EncryptData( String^ inName, String^ outName, array<Byte>^desKey, array<Byte>^desIV )
{

   //Create the file streams to handle the input and output files.
   FileStream^ fin = gcnew FileStream( inName,FileMode::Open,FileAccess::Read );
   FileStream^ fout = gcnew FileStream( outName,FileMode::OpenOrCreate,FileAccess::Write );
   fout->SetLength( 0 );

   //Create variables to help with read and write.
   array<Byte>^bin = gcnew array<Byte>(100);
   long rdlen = 0; //This is the total number of bytes written.

   long totlen = (long)fin->Length; //This is the total length of the input file.

   int len; //This is the number of bytes to be written at a time.

   DES^ des = gcnew DESCryptoServiceProvider;
   CryptoStream^ encStream = gcnew CryptoStream( fout,des->CreateEncryptor( desKey, desIV ),CryptoStreamMode::Write );
   Console::WriteLine( "Encrypting..." );

   //Read from the input file, then encrypt and write to the output file.
   while ( rdlen < totlen )
   {
      len = fin->Read( bin, 0, 100 );
      encStream->Write( bin, 0, len );
      rdlen = rdlen + len;
      Console::WriteLine( "{0} bytes processed", rdlen );
   }

   encStream->Close();
   fout->Close();
   fin->Close();
}
But I couldn't find REA... and I have a feeling there are hundreds more.... hmmm, well I wasn't expecting this to be easy, but I wasn't expecting it to be impossible either... =/
I have an encryptor I wrote a good 15+ years ago.. I should encrypt something and see if you can crack it
I'm impressed. I'm going to be checking in on your project and your source code looks great.
Do you honestly think that CA would make such a lowly encryption type?
Quote Originally Posted by zhaoyun333 View Post
Do you honestly think that CA would make such a lowly encryption type?
I would presume that it depends on what they're trying to protect....
I think they are using Unicode. Though I'm not sure what type so Im just going to guess UNC-32 ... it is UNC right? idk... Anyway does Unicode use w_char? I need to learn a lot more about text formats and such... =/.
Quote Originally Posted by why06 View Post
I think they are using Unicode. Though I'm not sure what type so Im just going to guess UNC-32 ... it is UNC right? idk... Anyway does Unicode use w_char? I need to learn a lot more about text formats and such... =/.
maybe it is an idea to make a program that seeks patterns in codes.
so you can find the common pieces of code guess what they mean and then try to decrypt them
Quote Originally Posted by lalakijilp View Post
maybe it is an idea to make a program that seeks patterns in codes.
so you can find the common pieces of code guess what they mean and then try to decrypt them
That's actually a pretty good idea. I wonder if the pattern would remain the same regardless how the text was encrypted?
Posts 115 of 23 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?