pues queria saber como puedo encriptar un archivo .ini ya que estoy probandolos para ver como se manejan para guardar variables pero al no estar encriptado podrias cambiar la vida o los puntos o lo que sea para hacer trampas :-X.

Gracias de antemano

Checa esto: ENCRIPTACION DE CADENAS

Y esto, s?lo si tienes GM8 Pro: ENCRIPTAR Y DECRIPTAR(EXTENSION GM7)
       

el segundo enlace no se que le pasa que si lo encripto y luego lo desencripto no sale lo mismo :-\ que pena me hubiera venido perfecto, y el primer enlace no se como podria usarlo para encriptar lo escrito en el archivo .ini

Quiz? puedas hacer lo que yo hice  XD
Usas WINRAR para cambiarle la extension al archivo...al archivo .ini lo cambie a archivo .dat
Te adjunto el winrar, para que funcione debes decomprimirlo...
espero que en algo te sea de ayuda  :(

no entiendo lo que me quieres decir, aun con extension .dat lo puedo abrir y cambiar el contenido asi que eso no serviria

hab?a un script para encriptar archivos binarios (nunca lo prob?) en desarrollo de scripts.
pero con el ultimo crivado se perdieron ese y muchos scripts utiles que, sin revivirlos, seguia yo usandolos.
Cita de: CGM 2008CGM: Un poco mas serios, mejores Juegos.
Bienvenid@ a CGM. Recomenzamos desde cero, con un reglamento mas estricto, mejor definido y con mas ganas que nunca de hacer juegos con calidad comercial. El que avisa no es traidor: Leete las reglas si no quieres llevarte un capon makero.
Mercilessly!!
Plug-In para animaciones: http://ciberman.net/tweenline/

La segunda descarga que puso Hackware la hice yo hace mucho tiempo y no funciona correctamente a veces... me disculpo por eso.

Ac? te dejo un script que te va a servir:
/*
**********************************************
************File Encryption System************
**********Written by: Kevin Haroldsen*********
**********************************************

Use this to encrypt/decrypt a file using XOR encryption.
It can be used to prevent editing of save files, or for other things.


Arguments:

The First Argument is the file you want to encrypt. Use a full path.
Make sure it is a string.

The Second Argument is the encryption key. It must be a string.
It can be as long as you want. Longer is more secure.


How it works:
The script generates a key based on the key you provide and the game id.
It then goes through the file and encrypts each byte using xor encryption,
rotating through the key. By rotating through the key, two identical letters next
to each other will not be look the same when encrypted. Sometimes the file is encrypted
enough that it is interpreted as Japanese in notepad- seeing it as Unicode.


How XOR encryption works:

XOR is a logic gate. The are 8 logic gates-AND,OR,XOR,YES,NAND,NOR,NXOR,and NOT.

When you enter values into a logic gate, it returns a value. All return either 0 or 1.
0 or 1 can mean No or Yes, False or True, or some others.

XOR generally allows you to input two values. If those values are the same, it will output 0.
Otherwise it will output 1.

Here is a truth table for XOR:
____________________
|Input1|Input2|Output|
|______|______|______|
|   0  |   0  |   0  |
|______|______|______|
|   1  |   0  |   1  |
|______|______|______|
|   0  |   1  |   1  |
|______|______|______|
|   1  |   1  |   0  |
|______|______|______|

This is simple boolean XOR.

Binary XOR uses boolean XOR to edit its values. With binary xor, it's almost like it's an operand like
addition or multiplication.

First of all, binary is a base 2 number system only using 0 and 1. It is what computers use.
Counting from 0 from 5 is
0
1
10
11
100
101
This is the binary system. With computers, a bit is a 0 or a 1. a byte is a group of 8 bits.

Binary XOR edits a whole byte of data.
The number 106 is 01101010
The number 203 is 11001011

So... 106 xor 203 is:

    0   1   1   0   1   0   1   0
    |   |   |   |   |   |   |   |
   \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/
xor 1   1   0   0   1   0   1   1
    -------------------------------
    1   0   1   0   0   0   0   1
   
10100001 is 161.
So, 106 xor 203 is 161.

Each letter or number in a text file is a byte. For example, the letter Q is 1010001.
So if you xor 1010001 (Q)  with 1001011 (K), you get 11010, which is a right arrow mark.
Now if you xor 11010 with 1001011 (K), you get 1010001, which is Q. So, you can encrypt and decrypt with a key.
   



NOTE:
Files encrypted with this will only be correctly decrypted with the same game- or at least with the
same game id.

Written January 6th 2010
*/

//define all variables
var file,read,keypos,key;

if !file_exists(argument0) then return (-1);

//define all variables.
keypos=0;
key=argument1
read=0
file=0

keypos=0;//make sure you are at the beginning of the key.

file=file_bin_open(argument0,2);//open the file, using basic binary functions

file_bin_seek(file,0);//make sure you are at the start of the file

//This is where you actually encrypt the file. Notice the actual encryption is only a few lines long.
repeat(file_bin_size(file))
{
    read=file_bin_read_byte(file);//read the chosen byte. Doing so will also advance to the next byte.
   
    file_bin_seek(file,file_bin_position(file)-1);//go to the byte before, returning to the byte that you just read.
   
    file_bin_write_byte(file,read ^ ord(string_char_at(key,keypos)));//write the encrypted byte where a byte was previously.It will advance to the next byte
    keypos+=1;//go to the next character in the key to encrypt with.
    if keypos>string_length(key) then keypos=1;
};

file_bin_close(file);//close the binary file when finished.

return (1);//returns 1 to confirm it worked.

El primer argumento es el nombre del archivo a encriptar y el segundo un "password". Para decriptar el archivo s?lo ten?s que usar la funci?n otra vez con el mismo password. Dale cr?dito al creador, Kevin Haroldsen.
Tambi?n en el script se explica c?mo funciona exactamente la encripci?n.
Vim.

muchisimas gracias por el script es justo lo que necesitaba :-*
muchas gracias a los demas por responder

Hola, acabo de probar el script. Encriptar encripta, eso si, pero no me desencripta, no se cual es el fallo, me repite la clave una y otra vez. No me pone el texto original.

Sabéis por que, se supone que es volver a usar el mismo script para desencriptar, no?

Encriptar("Boss.ini", "xxxxxx1111")

PD: USO STUDIO
Perdón por revivir, pero no encuentro nada útil, buffffffff

Mi mensaje de hace 5 años me da pena y vergüenza  XD XD XD Dios




Vamos a lo que en verdad importa. Bien, lo que sucede es que al parecer el método que lee bytes desde el archivo no mueve el indicador (por lo menos no en Studio) , por lo tanto hay que hacerlo manualmente. Por ello es que se produce el efecto de repeticion de encriptado, por ejemplo, el mensaje quedaría: "oggoggoggoggo..."

Lo que hay que hacer, es mover manualmente el indicador, para ello solo bastaría crear un contador dentro del script y moverlo de a 1 por cada repeticion del ciclo:

[GML]
var file,read,keypos,key, pos;

if !file_exists(argument0) then return (-1);

//define all variables.
keypos=0;
key=argument1
read=0
file=0
pos = 0;

keypos=0;//make sure you are at the beginning of the key.

file=file_bin_open(argument0,2);//open the file, using basic binary functions

file_bin_seek(file,0);//make sure you are at the start of the file

//This is where you actually encrypt the file. Notice the actual encryption is only a few lines long.
repeat(file_bin_size(file))
{
    pos++; // Incrementamos nuestro contador con cada iteracion

    read=file_bin_read_byte(file);//read the chosen byte. Doing so will also advance to the next byte.
   
    file_bin_seek(file,file_bin_position(file)-1);//go to the byte before, returning to the byte that you just read.
   
    file_bin_write_byte(file,read ^ ord(string_char_at(key,keypos)));//write the encrypted byte where a byte was previously.It will advance to the next byte
   
    file_bin_seek(file,pos); // Esta nuevo linea es la que hace la magia!
   
    keypos+=1;//go to the next character in the key to encrypt with.
    if keypos>string_length(key) then keypos=1;
};

file_bin_close(file);//close the binary file when finished.

return (1);//returns 1 to confirm it worked.
[/GML]

Espero que te sea de ayuda  :)

Mil gracias, encontré uno, pero que usa un encriptado simple, sin usar una clave, por lo tanto seria fácil de saltar sabiendo el método que se ha podido usar.
Con este ya debería de ser mas difícil al usar una key propia, inventada por mi.

Ya lo probare y te diré algo. Gracias

Cita de: Silver_light en Marzo 02, 2010, 10:32:07 PM
Quizá puedas hacer lo que yo hice  XD
Usas WINRAR para cambiarle la extension al archivo...al archivo .ini lo cambie a archivo .dat
Te adjunto el winrar, para que funcione debes decomprimirlo...
espero que en algo te sea de ayuda  :(

Primero de todo perdonar por responder tan tarde, pero tengo una duda y es que si por ejemplo mi archivo .ini lo cambio por .dat, desde android ese archivo no se podría abrir verdad? ya que mi juego seria para android. Igual rebuscando si que lo consigues abrir, o cambiándole la extensión, pero a simple vista no creo que la gente piense que es el archivo donde están todos los "datos" del juego.

Cita de: zHeMaa en Marzo 28, 2015, 08:26:14 AM
Cita de: Silver_light en Marzo 02, 2010, 10:32:07 PM
Quizá puedas hacer lo que yo hice  XD
Usas WINRAR para cambiarle la extension al archivo...al archivo .ini lo cambie a archivo .dat
Te adjunto el winrar, para que funcione debes decomprimirlo...
espero que en algo te sea de ayuda  :(

Primero de todo perdonar por responder tan tarde, pero tengo una duda y es que si por ejemplo mi archivo .ini lo cambio por .dat, desde android ese archivo no se podría abrir verdad? ya que mi juego seria para android. Igual rebuscando si que lo consigues abrir, o cambiándole la extensión, pero a simple vista no creo que la gente piense que es el archivo donde están todos los "datos" del juego.

Hola, te lo digo por experiencia,  la extensión no vale para mucho.  Lo unico que hace es decir k programa drbe abrirlo, pero tu puedes elegir otro. Es mas, yo tengo unos sin extensión,  y al abrirlo con el notepad, se ve perfectamente.

cambiar la extensión sin cambiar la estructura no lo hace más seguro, es lo mismo. Lo que hacía Silver_light sí cambiaba la estructura, porque de hecho comprimía el archivo.

Si es un usuario con poco conocimiento, aunque la extensión sea ini o dat, no tendrá noción de qué es o para qué sirve. Si es un usuario digamos, con algo de conocimiento, es muy probable que haga lo que mencionó arcangelcaos, abrir el archivo con un editor, sin importar la extensión que tenga.

Yo estas cosas no las hago, hay personas con capacidades para decompilar, descriptar, descifrar, lo que les envíes, personas como YO. A si que igual si alguien realmente quiere modificarlo para hacer trampas, lo va a hacer. Lo que si puedes hacer es que instalen en una ubicación distinta, y que los leas desde esa ubicación, de esta forma si desconciertas y mucho.
Atentamente.-
Elvis Kelley
Mi Manual.
Mi canal de Youtube Youtube click aqui
Video tutoriales Game maker