Hi,
I do it like this:
file_encrypt("data.dat","data.dat","data");
But it doesn't work for some reason.
I usually post game recordings to anyaudio. Click here to visit my anyaudio page
You are not logged in. Please login or register.
AudioGames.net Forum → Developers room → Problem with file encryption in bgt
Hi,
I do it like this:
file_encrypt("data.dat","data.dat","data");
But it doesn't work for some reason.
Burak, could you give some details?
what happens when the function is called? does it spawn a compiler error? Or does the file simply not encrypt?
Hi, it doesn't encrpyt at all not a compilation error.
file_encrypt("data.dat", "data1.dat", "key");
file_copy("data1.dat", "data.dat", true);
file_delete("data1.dat");
That's how you'd do it with data.dat, or you could make data1.dat be unencrypted saving you from copying an extra file. But your problem is that the files don't overwrite each other. You could also use string_encrypt which would work just as well, and would quite litterily be easier to restore the data, asuming you arn't working with like a sound file. If you are, do file, if not, string does the trick nicely, like this.
file f;
f.open("data.dat", "rb");
string data=string_encrypt(f.read(), "key");
f.close();
f.open("data.dat", "wb");
f.write(data);
f.close();
I wrote that in a hurry so please forgive any compolation errors, however I hope it helps.
AudioGames.net Forum → Developers room → Problem with file encryption in bgt
Generated in 0.025 seconds (31% PHP - 69% DB) with 11 queries