Jump to content

Some sort of File_Encrypt


Recommended Posts

I've been thinking of writing a File_Encrypt sort of function... The problem is I haven't been able to find a way to do it. I've tried reading text with some FileReadLine and then adding some random letters and then using _FileWriteToLine to replace te line.

I've been testing this with some of windows default .wav files, but whenever I edit anything they no longer can be opened, even after I change them back to how they should be.

Any ideas?

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

So it should encrypt it's data based on characters data or binary data? Encryption is not an easy process because it has to be ~fast and produce reversible decrypted data. I don't have any knowledge about the process but it's probably revolve binary manipulation of chunks of data on the file stream as well as efficient reversible encryption algorithm. You can use _StringEncrypt() to encrypt binary strings representation of the file content, as an easy approach.

Link to comment
Share on other sites

I had that problem too. When I used the encrypt and decrypt functions on small audio files they didn't play once decrypted. Is this a bug?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

So it should encrypt it's data based on characters data or binary data? Encryption is not an easy process because it has to be ~fast and produce reversible decrypted data. I don't have any knowledge about the process but it's probably revolve binary manipulation of chunks of data on the file stream as well as efficient reversible encryption algorithm. You can use _StringEncrypt() to encrypt binary strings representation of the file content, as an easy approach.

I suppose I do not really need to encode the entire file, just make the file unopenable.. I tried a simple script that would just add "jjj" to the front of the file... but then it wouldn't work when I took it out. I tried the samething without a script, just using notepad (right clicking and doing "Open with...") and if you even save the file once with some random letters it won't open again.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

You can read the file, xor it with your own key, it's easy I know, to make totally unuseable, once you want to revert to the original code, xor the encxor data with the same value. Make sure you read and work on the data in binary mode, image files have nothing to do with text (mostly).

Link to comment
Share on other sites

You can read the file, xor it with your own key, it's easy I know, to make totally unuseable, once you want to revert to the original code, xor the encxor data with the same value. Make sure you read and work on the data in binary mode, image files have nothing to do with text (mostly).

First of all, I'm using a laptop with no autoit installed on it.

How would I go about get the data of the file in binary mode? I've only tried File* functions but those don't seem to be working for what I want.

I suppose that I started off to specific in what I was asking. All I need is a way to lock files so that only the person with the password can access them. So if there's a way of doing that without encryption, that would work fine.

Thanks for any ideas

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...