Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


First solver gets my third +rep ever

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Sun Jun 13, 2010 7:51 am    Post subject: First solver gets my third +rep ever Reply with quote

So this is the joke.


My encryptor is as follows:

For each character in the string, starting with the first going to the last:
We shift each bit left once.
Then add 33
Then, if the character AND'd by 223 doesn't return 0, we shift each bit right once and subtract 16
Otherwise, we subtract 64 and THEN shift it right once.

We then XOR the resulting character by 179
Then we AND it by 127
Then we XOR is by 179 one more time.


Why does this encryption end up being easily converted to plain, readable text?

First to answer AND explain why their answer is correct(COMPLETELY EXPLAIN) get my first rep in 3 years, and third rep I've ever given ever ever Surprised Shit's valuable.

Everyone else has a moral obligation to bump.

P.S. If someone helps you get to the answer+explanation and you get my rep, you should damn well rep them too >_>

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
S3NSA
:3
Reputation: 1

Joined: 06 Dec 2006
Posts: 1914
Location: England.

PostPosted: Sun Jun 13, 2010 7:56 am    Post subject: Reply with quote

>Implying you could rep me if you tried

Crying or Very sad

_________________
~ You can find me on irc.ccplz.net x
Back to top
View user's profile Send private message Visit poster's website
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1858

PostPosted: Sun Jun 13, 2010 8:21 am    Post subject: Reply with quote

Working on it..

Code:
#include <Windows.h>
#include <stdio.h>

void FormatString( char* szInput, char* szOutput, int nSize ) {
  RtlZeroMemory( szOutput, 3 * nSize + 1 );

  for( int i = 0; i < nSize; i++ ) {
    sprintf_s( &szOutput[i*3], 3, "%02X", szInput[i] );
    szOutput[ ( i + 1 )*3 - 1 ] = ' ';
  }
}

int main() {
  char szTestString[] = "my test string";
  int  cbLength       = strlen( szTestString );

  char* szFormattedPlain = ( char* )malloc( 3*cbLength + 1 );
  FormatString( szTestString, szFormattedPlain, cbLength );
  printf_s( "%s\n", szFormattedPlain );
  free( szFormattedPlain );

  for( int i = 0; i < cbLength; i++ ) {
    szTestString[i] <<= 1;
    szTestString[i] += 33;

    if( ( szTestString[i] & 233 ) != 0 )
      szTestString[i] = ( szTestString[i] >> 1 ) - 16;
    else
      szTestString[i] = ( szTestString[i] - 64 ) >> 1;

    szTestString[i] ^= 179;
    szTestString[i] &= 127;
    szTestString[i] ^= 179;
  }

  printf_s( "%s\n", szTestString );

  char* szFormattedEnc = ( char* )malloc( 3*cbLength + 1 );
  FormatString( szTestString, szFormattedEnc, cbLength );
  printf_s( "%s\n", szFormattedEnc );
  free( szFormattedEnc );

  getchar();
  return 0;
}


My FormatString function is fucked and crashing after on the input after encryption. Am guessing it's to do with signed/unsigned maybe.. Just bashed this shit together in minutes. I intend to see first how it is easily converted. Then why that happens. Out of interest who did your previous 3 reps go to ?

Need to go do something else now.. will work on this tonight.
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Sun Jun 13, 2010 5:25 pm    Post subject: Reply with quote

Previous 2 reps** and I don't remember =/ It was 3 years ago lol.

Where are my solvers D:<

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1888
Location: Canada

PostPosted: Sun Jun 13, 2010 6:03 pm    Post subject: This post has 1 review(s) Reply with quote

Explanation in comments. End result is that the ASCII character is preserved, except the high bit is set.

Code:
string Encrypt(string s) {
   for(unsigned int i = 0; i < s.length(); i++) {
      // Character becomes even -> 0nnn nnnn -> nnnn nnn0
      s[i] <<= 1;
      // Character becomes odd.
      s[i] += 33;

      // Check if it is odd, always is.
      if(s[i] & 233) {
         // Undoes the last two operations.
         s[i] = (s[i] >> 1) - 16;
      } /*else { // Junk
         s[i] = (s[i] - 64) >> 1;
      }*/
      // Sets the high bit.
      s[i] ^= 179;

      // Clears the high bit.
      s[i] &= 127;

      // Reverses last xor. Except for the last bit.
      s[i] ^= 179;

      // End result. The high bit for every ascii character is set.
   }
   return s;
}

// What actually happens.
string SimpleEncrypt(string s) {
   for(unsigned int i = 0; i < s.length(); i++) {
      s[i] |= 0x80;
   }
   return s;
}
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1858

PostPosted: Sun Jun 13, 2010 6:06 pm    Post subject: Reply with quote

well done
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Sun Jun 13, 2010 6:11 pm    Post subject: Reply with quote

Very Happy

Unfortunately I meant to XOR by 79, not 179, so it would end up the same as it first was Sad. My excuse? Did this at 6:51am D:

Either way, I lubses you. +rep well earned (Why do I have more rep than you? You've been helping people lately more often than I have)

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1858

PostPosted: Sun Jun 13, 2010 6:12 pm    Post subject: Reply with quote

mainly because ipromise is fickle when it comes to allegiances
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites