Post: Encrypt Strings in GSC [alternate way]
07-23-2012, 09:53 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Well I have seen this done before, and usually it's either:

A: Huge List
B: Numbers

and that doesn't look really encrypted. So here is an alternate way of doing so.
Note: this is still shyt and will always be shyt but it's kinda a way to obfuscate gsc :fyea:

Functions:

    
strToArray(string)
{
array = [];
for(i=0;i<string.size;i++)
array[i] = GetSubStr( string, i, (i+1) );
return array;
}

arrayToStr(buffer)
{
string = "";
for(i=0;i<buffer.size;i++)
string += buffer[i];
return string;
}

arrayReverse(buffer)
{
array = [];
for(i=0;i<buffer.size;i++)
array[buffer.size - 1 - i] = buffer[i];
return array;
}

strReverse(string)
{
buffer = strToArray(string);
buffer = arrayReverse(buffer);
output = "";
for(i=0;i<buffer.size;i++)
output += buffer[i];
return output;
}

enc(string)
{
output = "";
charList = strToArray(string);
for(i=0;i<charList.size;i++)
{
for(j=0;j<level.charList.size;j++)
{
if(charList[i] == level.charList[j])
output += level.crypList[j];
}
}
return output;
}

dec(string)
{
output = "";
charList = strToArray(string);
for(i=0;i<charList.size;i++)
{
for(j=0;j<level.crypList.size;j++)
{
if(charList[i] == level.crypList[j])
output += level.charList[j];
}
}
return output;
}

enumerateCharacters()
{
level.charList = strToArray("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789!@#$%^&*()_+-=/\? [{}]<>,.|~`");
level.crypList = strToArray(strReverse("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789!@#$%^&*()_+-=/\? [{}]<>,.|~`"));
}



On Init:
    
level thread enumerateCharacters();


How to encrypt/decrypt:
    
self iPrintLnBold(enc("PREMIER-GAMER")); //outputs 73}$+}3h?`$}3
self iPrintLnBold(dec("73}$+}3h?`$}3")); //outputs PREMIER-GAMER
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Jakes625 for this useful post:

Harry, Illodgeical, Uk_ViiPeR
07-24-2012, 05:13 PM #2
So I would just have to put
    self iPrintlnBold(enc("Text I want encrypted"));

and then right down what it outputs in the game, and put that in the self iprotinlnbold(dec("")); part?
07-24-2012, 05:31 PM #3
Harry
Former Staff
Originally posted by GAMER View Post
Well I have seen this done before, and usually it's either:

A: Huge List
B: Numbers

and that doesn't look really encrypted. So here is an alternate way of doing so.
Note: this is still shyt and will always be shyt but it's kinda a way to obfuscate gsc :fyea:

Functions:

    
strToArray(string)
{
array = [];
for(i=0;i<string.size;i++)
array[i] = GetSubStr( string, i, (i+1) );
return array;
}

arrayToStr(buffer)
{
string = "";
for(i=0;i<buffer.size;i++)
string += buffer[i];
return string;
}

arrayReverse(buffer)
{
array = [];
for(i=0;i<buffer.size;i++)
array[buffer.size - 1 - i] = buffer[i];
return array;
}

strReverse(string)
{
buffer = strToArray(string);
buffer = arrayReverse(buffer);
output = "";
for(i=0;i<buffer.size;i++)
output += buffer[i];
return output;
}

enc(string)
{
output = "";
charList = strToArray(string);
for(i=0;i<charList.size;i++)
{
for(j=0;j<level.charList.size;j++)
{
if(charList[i] == level.charList[j])
output += level.crypList[j];
}
}
return output;
}

dec(string)
{
output = "";
charList = strToArray(string);
for(i=0;i<charList.size;i++)
{
for(j=0;j<level.crypList.size;j++)
{
if(charList[i] == level.crypList[j])
output += level.charList[j];
}
}
return output;
}

enumerateCharacters()
{
level.charList = strToArray("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789!@#$%^&*()_+-=/\? [{}]<>,.|~`");
level.crypList = strToArray(strReverse("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789!@#$%^&*()_+-=/\? [{}]<>,.|~`"));
}



On Init:
    
level thread enumerateCharacters();


How to encrypt/decrypt:
    
self iPrintLnBold(enc("PREMIER-GAMER")); //outputs 73}$+}3h?`$}3
self iPrintLnBold(dec("73}$+}3h?`$}3")); //outputs PREMIER-GAMER


wow man, thanks for helping the COD4 Community! i'm sure to be using this Winky Winky
07-24-2012, 05:36 PM #4
Originally posted by Illodgeical View Post
So I would just have to put
    self iPrintlnBold(enc("Text I want encrypted"));

and then right down what it outputs in the game, and put that in the self iprotinlnbold(dec("")); part?


yeah.

(10 chars)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo