|12-04-2010, 01:15 PM||#1|
[galaxy] ScEncrypt v0.01
IntroductionAs 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 http://xgm.ru/forum/attachment.php?attachmentid=65696
The library contains three user functions:
The last one should be launched from the initialization trigger.
The first function – scEncryptString(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 function – scDecryptString(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
Restrictions- source size: from (scEncryptMinDataSize =4) to (scEncryptMaxDataSize=4096)
- key size: from 2 to (scEncryptMaxDataSize=4096)
- input data can be written only in ASCII
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 =)
Last edited by ScorpioT1000 : 12-04-2010 at 02:00 PM.
|Thread Tools||Search this Thread|