Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 942 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Encryption SAV Verschlüsselung #313187
02/28/10 06:44
02/28/10 06:44
Joined: Feb 2010
Posts: 6
S
spiral75 Offline OP
Newbie
spiral75  Offline OP
Newbie
S

Joined: Feb 2010
Posts: 6
Hi,

I just purchased the Gamestudio Pro Edition for about EUR 800 where Gamestudio claims in the online-shop: Die Pro-Edition bietet noch höhere Geschwindigkeit, ein Datei-Pack-und Verschlüsselungsprogramm und 12 Monate Support.

But when I published my game (Resource checked) I found that SAV files do not get packed and that there is about no encryption of the SAV files. So for example passwords or game secrets stored in the SAV files which I would like to hide for the player can be read in clear text. You can try this easily by opening a sav file (SV-STRINGS) with a simple editor. For my understanding this cannot be the sense of time consuming game programming and of an expensive professional game programming software.

Gamestudio-Support wrote:


„The SAV files get packed and stored following an Huffman algorithm, the smaller the file the lower the compression rate. So you will be able to find small words in clear text….
We also could develop an intgrated solution for you for additional costs.
If this is a problem you have to encrypt the files with an external software…
Alternatively – if there are only some variables … you can encrypt these by yourself with a lite-C function.“

Is there any idea for a lite-C script for an encryption to solve this problem and to hide the secrets of my game?

Spiral75, February 28, 2010

Hallo,

ich habe mir die Gamestudio Pro Edition für ca. EUR 800 gekauft, weil Gamestudio in dem Shop wie folgt anbietet: Die Pro-Edition bietet noch höhere Geschwindigkeit, ein Datei-Pack-und Verschlüsselungsprogramm und 12 Monate Support.

Aber als ich dann damit mein Spiel gepublished hatte (Resource checked), stellte ich fest, dass SAV-Files nicht gepackt und fast nicht verschlüsselt werden. So können z.B. Passwörter oder Geheimnisse des Spiels, die in den SAV-Dateien hinterlegt sind, und die ich vor dem Spieler verbergen möchte, im Klarstext gelesen werden. Ihr könnt dies einfach ausprobieren, indem ihr eine SAV-Datei (SV-STRINGS) mit einen normalen Editor öffnet. Nach meiner Meinung kann das nicht der Sinn auwändiger Spieleentwicklung und der Anschaffung teurer professioneller Software zur Spiel-Programmierung sein.

Gamestudio-Support schrieb mir auf meine Anfrage:

„Die .SAV-Files werden komprimiert nach einem Huffman-Algorithmus abgespeichert; je kleiner die Datei ist, desto geringer ist die Kompressionsrate. Daher können Sie bei kleinen Dateien Bruchstücke des Klartextes finden...
Wir könnten auch eine einfache integrierte Lösung für Sie kostengünstig entwickeln.
Alternativ können Sie auch, wenn es sich nur um wenige Variablen handelt, ein eigenes Format mittels der file_ Funktionen abspeichern und dies ggf. selbst per lite-C Funktion verschlüsseln.“

Wo finde ich eine Anleitung zum Erstellen eines Lite-C-scripts für die Verschlüsselung, um die Geheimnisse meines Spiels doch noch zu verbergen?

Spiral75, 28.02.2010

Re: Encryption SAV Verschlüsselung [Re: spiral75] #313243
02/28/10 14:36
02/28/10 14:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hallo.
Ich benutze schon seit Februar 2001 gamestudio, bin aber noch nie auf die Idee gekommen, die SAV-games mit einem Editor zu öffnen. Ich musste aber eben nach einem Test leider feststellen, dass Sie Recht haben.
Es ist nicht schwierig, ein Verschlüsselungsprogramm zu implementieren, ich habe in der 12. Klasse die berühmte Enigma in gamestudio/ C-Script programmiert, ohne jegliche Ahnung von Algorithmen und co gehabt zu haben.
Eine Idee:

Mit file_var_write bspw. 4 Zahlen ohne Bedeutung in eine Textdatei schreiben, danach eine Zahl zwischen 1 und ~99 mit führender Null, die als Verschlüsselungscode dient. Von nun an wird jede Zahl auf diesen Code addiert und modulo 100 genommen, mit führender Null abgespeichert, jeder zu schreibende Buchstabe in seinen entsprechenden Zahlenwert umgewandelt, mit dem Code-Wert summiert und mit führender 1/2 abgespeichert. Zur weiteren Verwirrung des Hackers kann man alle 3-4 Zeichen eine sinnfreie Zahl hinzufügen. Die Datei speichert man dann als _dx_call.k o.ä. ab.
Die Entschlüsselung macht nun intern alles in umgekehrter Reihenfolge.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Encryption SAV Verschlüsselung [Re: spiral75] #313246
02/28/10 14:47
02/28/10 14:47
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Um ein Passwort verschlüsselt zu speichern, kannst du z.B. jedes Zeichen(= 1 Byte) einzeln schreiben und vorher um einen Bestimmten Wert verschieben:

Code:
str_cpy(str_passwort_temp,str_passwort);
var zeichen;
while(str_len(str_passwort_temp) > 0)
{
	zeichen = str_to_asc(str_passwort_temp);
	zeichen += 32; // Wert um 32 erhöhen
	zeichen %= 256; // Falls es über 256 ist, wird die Modulo-Funktion angewandt.
	file_asc_write(datei_die_du_geoeffnet_hast,zeichen);
	str_clip(str_passwort_temp,1);
}


Und beim Einlesen musst du das entsprechend um 32 verringern. Sieh dir dazu am besten mal die file_ und str_ Funktionen im Manual an.

Mit dieser Einfachen Verschlüsselung wird z.B. aus dem Wort
Passwort
dieses Wort:
p.““—.’”

Re: Encryption SAV Verschlüsselung [Re: Lukas] #313293
02/28/10 16:52
02/28/10 16:52
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
I've adapted an implementation of the RC4 algorithm (written in C by Sterling Camden and published under the Open Works License) to lite-C.

You can get it here:
http://www.gsportal.de/files/scripts/rc4.zip

It's pretty easy to use. A demo script is included.

Re: Encryption SAV Verschlüsselung [Re: Saturnus] #314329
03/07/10 18:34
03/07/10 18:34
Joined: Feb 2010
Posts: 6
S
spiral75 Offline OP
Newbie
spiral75  Offline OP
Newbie
S

Joined: Feb 2010
Posts: 6
Hallo Superku, Lukas und Saturnus,

Danke für die Tipps zur Verschlüsselung.

Ja, das kann schon den Sinn eines ganzen Spiels in Frage stellen, wenn die SAV-Dateien nicht verschlüsselt werden.

Ich bin noch Anfänger und muss mich erst langsam einarbeiten.

Daher danke ich auch Lukas und Saturnus für die Scripts für die Verschlüsselung.

Die enthalten für mich natürlich noch viel Neues.

Ich habe mich zwar intensiv damit beschäftigt, hänge nun aber schon seit ein paar Tagen an einem Problem, das ich nicht lösen kann.

Wie stelle ich "string_passwort_temp" aus dem Script von Lukas auf dem Bildschirm dar?

So wie im Folgenden geht es jedenfalls nicht:

TEXT* passwort_str =
{
FONT = schrift;
LAYER = 10;
POS_X = 100;
POS_Y = 100;
STRING = string_passwort_temp;
FLAGS = NARROW, CENTER_X;

}

Und wie kann ich die erzeugte Text-Datei, die "string_passwort_temp" enthält, mit einer zweiten vergleichen?

So wie im Folgenden geht es jedenfalls nicht:

if(str_cmp("text1.txt", "text2.txt")) == 1


{…}

spiral75, 07.03.2010


Hi Superku, Lukas and Saturnus,

thank you for the advice regarding the encyption.

Well, it can make a game senseless it the SAV files are not encrypted.

I am still a beginner and only proceed slowly.

So thank you to Lukas and Saturnus for the encryption scripts.

They contain a lot of new things for me.

Although I studied the scripts intensively there remained some problems which I could not solve.

How do I bring the content of "string_passwort_temp" from Lukas's script on the screen?

It does not work this way:

TEXT* passwort_str =
{
FONT = schrift;
LAYER = 10;
POS_X = 100;
POS_Y = 100;
STRING = string_passwort_temp;
FLAGS = NARROW, CENTER_X;

}

And how can I compare the text file which contains "string_passwort_temp" with a second one?

It does not work as follows:

if(str_cmp("text1.txt", "text2.txt")) == 1


{…}

spiral75, March 07, 2010

Re: Encryption SAV Verschlüsselung [Re: spiral75] #314335
03/07/10 19:05
03/07/10 19:05
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
ich würde auf keinen fall einen reversiblen prozess verwenden. speichere in den .sav-files NUR einen hash, alles andere ist total unsicher.
benutzernamen sind benutzernamen und sollten nicht vertraulich sein müssen. dafür ist das passwort da.

Re: Encryption SAV Verschlüsselung [Re: Joey] #314388
03/08/10 09:59
03/08/10 09:59
Joined: Mar 2007
Posts: 112
MikeS Offline
Member
MikeS  Offline
Member

Joined: Mar 2007
Posts: 112
TEXT* passwort_str =
{
FONT = schrift;
LAYER = 10;
POS_X = 100;
POS_Y = 100;
STRING = string_passwort_temp;
FLAGS = NARROW, CENTER_X;

}

Auf deine Frage: Das hier ist schon fast richtig, fehlt nur noch das flag für Show
Flags = SHOW

Ansonsten ist der ganze text natürlich unsichtbar, und du siehst nichts.

Gruß

Last edited by MikeS; 03/08/10 10:00.
Re: Encryption SAV Verschlüsselung [Re: MikeS] #314389
03/08/10 10:00
03/08/10 10:00
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
ähm, flags |= (NARROW | CENTER | SHOW);

Re: Encryption SAV Verschlüsselung [Re: Rei_Ayanami] #314390
03/08/10 10:27
03/08/10 10:27
Joined: Jul 2007
Posts: 53
Germany
Henning Offline
Junior Member
Henning  Offline
Junior Member

Joined: Jul 2007
Posts: 53
Germany
Hello,

at your comparison is a bracket at the wrong place:
if(str_cmp("text1.txt", "text2.txt")) == 1

should be:
if(str_cmp("text1.txt", "text2.txt") == 1) {...

or:
if(str_cmp("text1.txt", "text2.txt")) {...

Re: Encryption SAV Verschlüsselung [Re: Henning] #314391
03/08/10 10:30
03/08/10 10:30
Joined: Mar 2007
Posts: 112
MikeS Offline
Member
MikeS  Offline
Member

Joined: Mar 2007
Posts: 112
Originally Posted By: Henning
Hello,

at your comparison is a bracket at the wrong place:
if(str_cmp("text1.txt", "text2.txt")) == 1

should be:
if(str_cmp("text1.txt", "text2.txt") == 1) {...

or:
if(str_cmp("text1.txt", "text2.txt")) {...


Im not realy sure if you are able to check .txt files against each other. I only know the posibility to check strings against each other.

If im wrong, please correct me.

So, in my opinion, you had to open your file, take a string out of this file (i think with file_read or something, check in the manual) and make the str_cmp check with this strings.

Greetings

Mike


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1