-
March 14th, 2017, 11:17 AM
#1
Creating protected files filled with data
Hello, I am making a game and I want to store highscores inside a file.
How do I make this data protected so no one could edit anything.
For now, I encrypted the score and put it into file and when loading it I can decrypt it. All these encrypted strings are inside file "scores.txt".
Is it possible to create a file with custom extension that no one could open ?
-
March 14th, 2017, 11:31 AM
#2
Creating custom file extensions
Hello,
I made a game and I store my scores in text file, but before that I encrypt them... later I can decrypt them.
How can I create a custom file that no one will be able to open it except for me ?
e.g File "scores.myext" that will contain my scores.
-
March 14th, 2017, 12:17 PM
#3
Re: Creating protected files filled with data
Victor Nijegorodov
-
March 14th, 2017, 12:21 PM
#4
Re: Creating protected files filled with data
Any reason not to use the registry?
-
March 14th, 2017, 01:36 PM
#5
Re: Creating protected files filled with data
How can I create a custom file that no one will be able to open it except for me
The computer administrator account can always obtain sufficient privileges and permissions to be able to open and read (and modify) the content of any file on the system. However, there are what is called alternate data streams that can be associated with a file, the contents of which don't show if you just use the normal ways to view a file. These alternate data streams of a file are given names and you need to know both the file name and the stream name to be able to access this alternate data. There are only a few standard programs that work properly with these alternate streams. See https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
March 15th, 2017, 03:36 AM
#6
Re: Creating protected files filled with data
Just serialize your data in a file with custom extension, and only your application could de-serialize your data ... there is a lot of examples on internet that show you how to serialize integers, strings, etc.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|