Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm using python to store user data in text file right now. But it is easily accessible by user.
How to store in it in a file format the user can access.

What I have tried:

Im new to this. I have only tried to store it in text file till now.
Pls help.
Posted
Updated 18-Jun-20 6:54am
v2
Comments
F-ES Sitecore 18-Jun-20 10:33am    
Easiest way is probably to encrypt the file then decrypt it when you read it back. To preempt your next question, google "python encrypt text".

You can't - if your app has access to a file, so does your user. The only solution is to encrypt the datafile, but even that isn't perfect as your app needs access to the encryption key to encrypt and decrypt the file, so it is possible to decompile the EXE and get the key that way.

You need to think about what you are trying to do, and why: for example, a "licence file" could use hashing of machine details instead of encryption, and so forth.
 
Share this answer
 
There are a couple of options available...

1. Encrypt or otherwise obfuscate the contents of the file.
2. Use a different type of file format that the user does not have a "viewer" for.
3. Save the data in a place that file-access (or other) permissions are in place
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900