sc2c.org

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

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

Introduction
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 http://xgm.ru/forum/attachment.php?attachmentid=65696

The library contains three user functions:
Code:
//==== 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
Restrictions
- 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 =)
Original: http://xgm.ru/forum/showthread.php?t=42668
Attached Files
File Type: zip ScEncrypt v0_01.zip (27.8 KB, 2 views)

Last edited by ScorpioT1000 : 12-04-2010 at 03:00 PM.
ScorpioT1000 is offline   Reply With Quote
Old 12-04-2010, 02:16 PM   #2
Toadcop
Member
 
Toadcop's Avatar
 
Join Date: Apr 2010
Posts: 36
Default

i like russian vodka !
Toadcop is offline   Reply With Quote
Old 12-05-2010, 06:16 PM   #3
XimikS
xgm.ru <3
 
XimikS's Avatar
 
Join Date: Oct 2010
Location: russia, kalmykia
Posts: 8
Default

Quote:
Originally Posted by XimikS
Там тоже уныло
...and toadcop!
XimikS is offline   Reply With Quote
Old 12-05-2010, 06:16 PM   #4
XimikS
xgm.ru <3
 
XimikS's Avatar
 
Join Date: Oct 2010
Location: russia, kalmykia
Posts: 8
Default

awesome library -/-
XimikS is offline   Reply With Quote
Old 01-21-2011, 10:30 PM   #5
Toadcop
Member
 
Toadcop's Avatar
 
Join Date: Apr 2010
Posts: 36
Default

obsolete ?
Toadcop is offline   Reply With Quote
Old 01-22-2011, 01:49 AM   #6
Enviable Lemon
Reputation Leech
 
Enviable Lemon's Avatar
 
Join Date: Sep 2010
Posts: 28
Send a message via AIM to Enviable Lemon
Default

vodka? you tell me
Enviable Lemon is offline   Reply With Quote
Old 02-04-2011, 08:19 AM   #7
ScorpioT1000
Junior Member
 
ScorpioT1000's Avatar
 
Join Date: Apr 2010
Posts: 6
Send a message via ICQ to ScorpioT1000
Default

Russian Standart

Last edited by ScorpioT1000 : 02-07-2011 at 08:33 AM.
ScorpioT1000 is offline   Reply With Quote
Reply


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 08:10 PM.


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