how to encrypt something i know how to decrypt

11/22/2013 23:27 i picked the red pill too#1
at the interaction 1022 packet, magic subtype
here is how to decrypt

Code:
                            #region GetSkillID
                            SpellID = Convert.ToUInt16(((long)attack.ToArray()[24] & 0xFF) | (((long)attack.ToArray()[25] & 0xFF) << 8));
                            SpellID ^= (ushort)0x915d;
                            SpellID ^= (ushort)attacker.UID;
                            SpellID = (ushort)(SpellID << 0x3 | SpellID >> 0xd);
                            SpellID -= 0xeb42;
                            #endregion
                            #region GetCoords
                            X = (ushort)((attack.ToArray()[16] & 0xFF) | ((attack.ToArray()[17] & 0xFF) << 8));
                            X = (ushort)(X ^ (uint)(attacker.UID & 0xffff) ^ 0x2ed6);
                            X = (ushort)(((X << 1) | ((X & 0x8000) >> 15)) & 0xffff);
                            X = (ushort)((X | 0xffff0000) - 0xffff22ee);

                            Y = (ushort)((attack.ToArray()[18] & 0xFF) | ((attack.ToArray()[19] & 0xFF) << 8));
                            Y = (ushort)(Y ^ (uint)(attacker.UID & 0xffff) ^ 0xb99b);
                            Y = (ushort)(((Y << 5) | ((Y & 0xF800) >> 11)) & 0xffff);
                            Y = (ushort)((Y | 0xffff0000) - 0xffff8922);
                            #endregion
                            #region GetTarget
                            Target = ((uint)attack.ToArray()[12] & 0xFF) | (((uint)attack.ToArray()[13] & 0xFF) << 8) | (((uint)attack.ToArray()[14] & 0xFF) << 16) | (((uint)attack.ToArray()[15] & 0xFF) << 24);
                            Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ attacker.UID) - 0x746F4AE6;
                            #endregion
so how to encrypt that in the first place ?
i would love a spoon feeding but i would really appreciate some mathematical references and tutorials
11/23/2013 02:29 { Angelius }#2
It sounds like you are willing to learn and put some effort into it so my advice to you is to ignore ,u reply for now and wait for educational replies before you open the spoiler..

Spoon feeding 101.

11/23/2013 03:03 i picked the red pill too#3
as much as i want to just use it to make the bot full functional ill respect your willing and wait for the next day, but im pretty sure not so much over here want to help out (specially when it comes to a bot related subject)
11/23/2013 20:32 pro4never#4
You need to perform the same operations in reverse.

So lets say for example I know that I can 'decrypt' something through the following process

SkillID += 100;
SkillID /= ClientID;
SkillID ^= 12345;

We can reverse this and say the 'encryption' method would be

SkillID ^= 12345;
SkillID *= ClientID;
SkillID -= 100;


Note: The reverse of XOR is XOR, bit shifting left is replaced with bitshifting right, etc.

Might suggest doing some reading on the subject of boolean algebra so you understand what's going on in the background.

Boolean algebra - Wikipedia, the free encyclopedia
11/24/2013 03:46 i picked the red pill too#5
Quote:
Originally Posted by pro4never View Post
You need to perform the same operations in reverse.

So lets say for example I know that I can 'decrypt' something through the following process

SkillID += 100;
SkillID /= ClientID;
SkillID ^= 12345;

We can reverse this and say the 'encryption' method would be

SkillID ^= 12345;
SkillID *= ClientID;
SkillID -= 100;


Note: The reverse of XOR is XOR, bit shifting left is replaced with bitshifting right, etc.

Might suggest doing some reading on the subject of boolean algebra so you understand what's going on in the background.

Boolean algebra - Wikipedia, the free encyclopedia
thanks for the information, i was never aware i could use boolean algebra at this, but i would try to dig deeper at it, but still their is more operations that i duno how to reverse, that's why i need atleast a key to search for like boolean algebra