Post: String Encryption/Decryption, much better than before
07-26-2012, 06:57 PM #1
Choco
Respect my authoritah!!
(adsbygoogle = window.adsbygoogle || []).push({}); Seeing all these other string encryption/decryption attempts lately, I noticed that they all are easily crackable and are really nothing more than replacement of characters. I decided to to try and make one that is a bit more difficult to crack, and this was the result I got Winky Winky

Here is an example of what the string "nextgenupdate" looks like beside it's encrypted form (picture is from HxD, because special characters were used and they won't show on this site):

You must login or register to view this content.

Here are the functions you need:

    Encrypt( string )
{
encryptedString = "";
split = int( string.size / 2 );
part1 = GetSubStr( string, 0, split );
part2 = GetSubStr( string, split, string.size );
strCrypt = reverseStr( part1 );
for( i = 0; i < strCrypt.size; i++ )
{
num = GetCharacterID( strCrypt[i] );
encryptedString += level.encChar[num];
}
strCrypt = reverseStr( part2 );
for( j = 0; j < strCrypt.size; j++ )
{
num = GetCharacterID( strCrypt[j] );
encryptedString += level.encChar[num];
}
return encryptedString;
}

Decrypt( string )
{
decryptedString = "";
split = int( string.size / 2 );
part1 = GetSubStr( string, 0, split );
part2 = GetSubStr( string, split, string.size );
strCrypt = reverseStr( part1 );
for( i = 0; i < strCrypt.size; i++ )
{
num = GetEncCharacterID( strCrypt[i] );
decryptedString += level.fullChar[num];
}
strCrypt = reverseStr( part2 );
for( j = 0; j < strCrypt.size; j++ )
{
num = GetEncCharacterID( strCrypt[j] );
decryptedString += level.fullChar[num];
}
return decryptedString;
}

GetEncCharacterID( char )
{
for( i = 0; i < level.encChar.size; i++ )
{
if( char == level.encChar[i] )
return i;
}
return 0;
}

GetCharacterID( char )
{
for( i = 0; i < level.fullChar.size; i++ )
{
if( char == level.fullChar[i] )
return i;
}
return 0;
}

reverseStr( string )
{
out = "";
for( n = string.size - 1; n >= 0; n-- )
out += string[n];

return out;
}


You will also need this under init():

    fullCharList = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789`~!@#$%^&*()-_+=\|}]{[':;/?.>,< ";
encCharList = "** ********** ![#$%&'()01á3ü56é89@A¿]DÜ{ñTIÍrº}zvVÑXY`abídófÚhÉpqrÓúuvÁx¡€‚ƒ„…†‡ˆ‰‘’“”";

level.fullChar = [];
for( j = 0; j < fullCharList.size; j++ )
level.fullChar[j] = fullCharList[j];

level.encChar = [];
for( i = 0; i < encCharList.size; i++ )
level.encChar[i] = encCharList[i];


Here is a You must login or register to view this content. for the GSC file containing all of these scripts, you need it because the characters used in encryption won't show up on NGU.

Enjoy Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to Choco for this useful post:

Harry, INSAN3LY_D34TH, Kush Friendly, LightModz, Script Kiddie, Taylor, Uk_ViiPeR
07-26-2012, 07:08 PM #2
Originally posted by Choco View Post
I decided to to try and make one that is a bit more difficult to crack


No type of encryption is difficult to "crack" in the context of gsc modding.

There was a long thread a while back that went through all of this..
07-26-2012, 07:23 PM #3
Choco
Respect my authoritah!!
Originally posted by x. View Post
No type of encryption is difficult to "crack" in the context of gsc modding.

There was a long thread a while back that went through all of this..


Yes, but this one is at least something a little different. There is no real practical use for it, just testing what I can do with GSC really. To reverse this encryption you have to split the string in half, reverse each half, and then go through all the characters replacing them. It's not truly "encryption" but its just a way of making strings more obfuscated.
07-26-2012, 08:15 PM #4
Originally posted by Choco View Post
To reverse this encryption you have to split the string in half, reverse each half, and then go through all the characters replacing them. It's not truly "encryption" but its just a way of making strings more obfuscated.


You can always just print out the solution Winky Winky

It's more an exercise in programming rather than gsc modding though so I'm sure some people find it interesting. Personally, I only like things that have explosions....

The following 2 users say thank you to x_DaftVader_x for this useful post:

Correy, Harry
07-26-2012, 09:07 PM #5
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by x. View Post
You can always just print out the solution Winky Winky

It's more an exercise in programming rather than gsc modding though so I'm sure some people find it interesting. Personally, I only like things that have explosions....


I like things that explode :happycry:.

EDIT: Just realised how gay that sounded :FU:.

The following user thanked IVI40A3Fusionz for this useful post:

07-26-2012, 10:08 PM #6
Taylor
Former Black Knight.
Originally posted by IVI40A3Fusionz View Post
I like things that explode :happycry:.

EDIT: Just realised how gay that sounded :FU:.


Correction, you like things that explode white

The following user thanked Taylor for this useful post:

07-26-2012, 11:00 PM #7
Blackstorm
Veni. Vidi. Vici.
lol my encryption was the only useful one cause I actually had a gui to it and the decryption function was only for gsc
07-26-2012, 11:03 PM #8
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by xYARDSALEx View Post
Correction, you like things that explode white


Ohai there 1337 poster Winky Winky, thought i'd provide a snapshot for this momentous occasion.

You must login or register to view this content.
07-27-2012, 01:54 AM #9
Taylor
Former Black Knight.
Originally posted by IVI40A3Fusionz View Post
Ohai there 1337 poster Winky Winky, thought i'd provide a snapshot for this momentous occasion.

You must login or register to view this content.


:confused: wat????
07-27-2012, 12:49 PM #10
Originally posted by Blackstorm View Post
lol my encryption was the only useful one cause I actually had a gui to it and the decryption function was only for gsc


Maybe, but it still only took me 2 mins to break it Outie

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo