.txt with password in C?

5

I'm messing around with .txt file manipulation and I was wondering how to create a .txt file with a password in C, so that this file can not be opened by Notepad or another program without the password. And then if I wanted to open the file I could use it in the C program using the password.

Encode the contents of the .txt I already know how to do, type change the content of it to symbols and then recover, but what I want to do is make the file not "unlockable" without the password.

    
asked by anonymous 27.08.2018 / 19:07

1 answer

1

I know that time has passed but the question has a clear answer: A text file is nothing more than a sequential character . Therefore, does not feature any feature that allows you to do anything other than storing such character sequences that can be perfectly read by any programs.

The exception, not to say it does not have permission to read / execute / write files according to users of a device or application where each user sends and downloads in their own files. For example: [email protected] does not read emails from [email protected] unless it allows. But this file management is another completely different topic and does not apply to the case .

To reach your goal, you can follow one of the suggestions you've been given in the question: from creating a ZIP (or equivalent) with the pure text file. Of course it would not be as trivial as simply manipulating a simple text file.

Another alternative is to create your own file template with your encryption. So, only your program could decrypt

    
21.12.2018 / 09:17