Results 1 to 7 of 7
  1. #1
    Saltine's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    493
    Reputation
    104
    Thanks
    629

    Rotational XOR Encryption

    Well it seems that people here seem to be under the impression that XOR is the only way to go in encryption, so I figured I'd demonstrate a little combination of a few methods I whipped up to enhance security. So basically what this method does is first it XOR's each character against a key. Then, it rotates the bits of each character, fucking up the string a bit more. After that, it adds the index of each character to it to remove the issue that characters which are the same are still the same after encryption. This is still not great, but it is more secure than standard XOR which can be cracked easily.
    Code:
    #define rotateRight(a) __asm ror a, 1
    #define rotateLeft(a)	 __asm rol a, 1
    enum rotDir{
    	ROT_LEFT,
    	ROT_RIGHT
    };
    char* xor(char* str, int key){
    	int len = strlen(str);
    	char* x = new char[len];
    	for(int i = 0; i < len; ++i)
    		x[i] = str[i]^key;
    	x[len] = 0;
    	return x;
    }
    char* rotEachChar(char* str_, rotDir ROTDIR){
    	int len = strlen(str_);
    	char* x = new char[len];
    	char cur;
    	if(ROTDIR==ROT_LEFT){
    		for(int i = 0; i < len; ++i)
    		{
    			cur = str_[i];
    			rotateLeft(cur)
    			x[i] = cur;
    		}
    	}
    	else if (ROTDIR == ROT_RIGHT)
    	{
    		for(int i = 0; i < len; ++i)
    		{
    			cur = str_[i];
    			rotateRight(cur)
    			x[i] = cur;
    		}
    	}
    	else 
    		return "******s";
    	x[len] = 0;
    	return x;
    }
    char* addEach(char* str){
    		int len = strlen(str);
    		char* x = new char[len];
    		for(int i = 0; i < len; ++i)
    			x[i] = str[i] + i;
    		x[len] = 0;
    		return x;
    }
    char* subEach(char* str){
    		int len = strlen(str);
    		char* x = new char[len];
    		for(int i = 0; i < len; ++i)
    			x[i] = str[i] - i;
    		x[len] = 0;
    		return x;
    }
    char* encrypt(char* text, int key){
    	return addEach(rotEachChar(xor(text,key),ROT_RIGHT));
    }
    char* decrypt(char* text, int key){
    	return xor(rotEachChar(subEach(text),ROT_LEFT),key);
    }
    Code:
    encrypt() and decrypt() are the only methods you should be calling, the others are used only to perform each individual step.
    Hope this bumps you guys in the right direction. Example usage to prove it works:
    Code:
    	char* x = encrypt("HURR DURR IM AN PIZZA",13);
    	char* y = decrypt(x,13);
    	cout << "HURR DURR IM AN PIZZA"<<endl << x << endl << y;
    Outputs:

    If you have any questions dont hesitate to ask. Also don't hesitate to tell me where I made mistakes/ have left room for improvement. Don't mind the unnecessary use of construct like the enum, just did that for the lulz. Also, Rotational XOR Encryption is a BS name, just sounded cool :P
    The reason I release this in this section is because the users of this section are those in most dire need of what I have to offer. That is all.

    Oh no! Vortex is gay!

  2. The Following 7 Users Say Thank You to Saltine For This Useful Post:

    Departure (10-31-2012),[MPGH]Flengo (10-31-2012),luccss (10-31-2012),New - Hacker (11-03-2012),Otaviomorais (10-31-2012),pDevice (10-31-2012),Timboy67678 (05-15-2014)

  3. #2
    nigger's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    224
    Reputation
    64
    Thanks
    95
    dis here iz da coolest encryption ah've seen in uh while. pimp-tight motha fuckin werk it's amazing all ye damn hood ratz..

  4. The Following User Says Thank You to nigger For This Useful Post:

    Saltine (10-30-2012)

  5. #3
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    @Saltine good work and yes its a lot better than normal xor.. there is one slight problem... your encrypted results can go outside the ascii table boundary, meaning it can and will generate non readable characters, this is fine if you want to first convert all your string to byte array ready for decryption, but wouldn't it be a lot easier to input readable strings, you can do this of cause by using mod function in your algo so you stay within the readable characters.
    DJector.Lite
    Get the advantages of new injection technology, with 1 click easy to use injector, work for all platforms x86/x64

    Download

    D-Jector
    Get the most advanced and full featured injector around, works for any game and any platform x86/x64, nothing comes even close.
    Download

  6. The Following User Says Thank You to Departure For This Useful Post:

    Saltine (10-31-2012)

  7. #4
    hfe636's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    1
    My Mood
    Amazed
    helped me understand a little more about what i have to do bad thing is i have no idea how to do it LOL so help me please

    ok so i have this


    Code:
    #define STRING_Pickup /*PickupHack*/Dencrypt("Pickup")
    #define STRING_WireFrameP /*WireFrame*/Dencrypt("")
    #define STRING_Skeleton /*Skeleton*/Dencrypt("")
    and i need this


    Code:
    #define STRING_NxChams /*Nx Chams*/Dencrypt("{¥Mp•Žš*")
    #define STRING_ShowxFPS /*Show FPS*/Dencrypt("€•œ¤Ms}€")
    #define STRING_CrossHair /*CrossHair*/Dencrypt("pŸœ**uŽ–Ÿ")

    basically i need to find a way to turn the Pickup WireFramep and Skeleton into the decrypt code like i have it there for Nx Chams Show FPS and CrossHair


    So please help if anyone knows and understands how to make this possible ^.^

  8. #5
    GoldWhite's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    136
    Reputation
    10
    Thanks
    46
    Can you give me compiled project?

  9. #6
    gamer2125's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Posts
    237
    Reputation
    9
    Thanks
    185
    My Mood
    Cheerful
    That is pretty pimpin.

  10. #7
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,589
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Quote Originally Posted by GoldWhite View Post
    Can you give me compiled project?
    There's nothing to compile
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


Similar Threads

  1. [Release] XOR Encryption Class
    By Saltine in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 19
    Last Post: 12-16-2011, 05:11 AM
  2. Encrypting Trainers
    By nub_g0t_high in forum WarRock - International Hacks
    Replies: 1
    Last Post: 11-10-2007, 01:24 PM
  3. Basic Encryption
    By Calard in forum General Game Hacking
    Replies: 0
    Last Post: 02-23-2007, 06:32 AM
  4. Sig Rotator
    By blahblahz in forum Tutorials
    Replies: 5
    Last Post: 05-15-2006, 03:02 AM
  5. Encryption on Files
    By HolyFate in forum Gunz General
    Replies: 15
    Last Post: 02-20-2006, 01:50 PM