Go Back > Developer's Corner > Scripting
User Name
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 12-04-2010, 01:15 PM   #1
Junior Member
ScorpioT1000's Avatar
Join Date: Apr 2010
Posts: 6
Send a message via ICQ to ScorpioT1000
Lightbulb [galaxy] ScEncrypt v0.01

As far as I know, the data of Starcraft II banks isn't encrypted, therefore they are accessible for modifying. The only solution is to encrypt data like save/load systems.
Special thanks to NETRAT for helping with algorithms.
How to use it?
First include the ScEncryptLibrary source to the map code.
For example, so

The library contains three user functions:
//==== Encrypt portion of data: string scEncryptString(string source, string key) //==== Decrypt portion of data: string scDecryptString(string coded, string key) //==== On Initialize event: bool scEncryptInit()

The last one should be launched from the initialization trigger.

The first functionscEncryptString(string source, string key) – takes:
- the source string. It can be any string, where it is possible to write down any levels, resources, stats and other parameters of your game which should be encrypted. It's important to ensure, that your algorithm is properly serializing data and also getting it back in reverse order.
- the secret key. There are some complexities. We'd simply used <user name> + <any data> to make the unique key in WC3, but there's no such possibility in SC2. I think that you should offer the player to "log in" in your map, i.e. enter his permanent password. After that we somehow transform our virtual password (say, we still have a "name of the current game") and generate the secret key, which is used later do data decryption.

Function returns the code from scEncryptAlphabet characters which can be pushed in bank or shown to the user (public key). Remember, the O 'ou' and 0 'zero' characters in SC2 font are absolutely identical.

The second functionscDecryptString(string source, string key) – takes:
- the coded string. It is the code returned by scEncryptString, named public key.
- the secret key, described above.

Function returns your decrypted data.

Function scassert is called on I/O errors, overflows, etc., where scisassert == 1 and scassertnotes == reason
- source size: from (scEncryptMinDataSize =4) to (scEncryptMaxDataSize=4096)
- key size: from 2 to (scEncryptMaxDataSize=4096)
- input data can be written only in ASCII
- single-threading

Note: it's not recommended to use some identical symbols successively, it reduces privacy of the key
Give me some examples!
Examples and source files are in the attachment.

Sorry for my english =)
Attached Files
File Type: zip ScEncrypt (27.8 KB, 2 views)

Last edited by ScorpioT1000 : 12-04-2010 at 02:00 PM.
ScorpioT1000 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT. The time now is 05:11 PM.

Powered by vBulletin
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.