473,511 Members | 15,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide my data

23 New Member
I am writing a word game, and my word lists are copied from an external text file during development time, and embedded within the program (the .EXE file). How do I hide these word lists from prying eyes who browse the .EXE file?
Thank you!
Jul 28 '20 #1
15 3338
Banfa
9,065 Recognized Expert Moderator Expert
Use a simple encryption algorithm like rot13 or XOR cipher. Or if you want a challenge and to learn something use a more complex encryption algorithm like AES or DES.
Jul 28 '20 #2
DGrund
23 New Member
Thanks for the response, but it doesn't quite apply.
I have an external list. I "add file", bringing that into Visual Studio. That makes the list visible in the .EXE file after I build. I need to encrypt it BEFORE I bring it in, and decrypt it AFTER the program starts running. I don't have a problem with challenges, but I would like to jump this hurdle first. :) Thank you.
Jul 28 '20 #3
Rabbit
12,516 Recognized Expert Moderator MVP
That's pretty much what they were suggesting
Jul 28 '20 #4
DGrund
23 New Member
@Rabbit: Why did you even chime in if you didn't have anything to provide? :) "Use a simple encryption algorithm" is not very specific, and therefore not very helpful. If I knew what I had to do, I wouldn't be asking for ideas.
Jul 28 '20 #5
Rabbit
12,516 Recognized Expert Moderator MVP
You said what Banfa was suggesting didn't apply. I was just pointing out what they were suggesting was the exact thing you were asking for.

And Banfa did provide several specific algorithms that you could use. Rot13, XOR, AES, and DES are all specific encryption algorithms you could use.

From my perspective, you ignored Banfa's suggestion.

You asked, "How do I hide my data?"

Banfa responded, "You can hide your data using encryption such as rot13, xor, aes, or des."

Your reponse was, "That's not what I'm looking for. I'm looking for encryption."
Jul 28 '20 #6
Banfa
9,065 Recognized Expert Moderator Expert
For your situation
  1. Encrypt the file with the words in
  2. Import it into your exe
  3. Include code in your exe to decrypt it when you access the text data.

ROT13 or XOR cipher should work fine for that (look them up on wikipedia). You may need to write a small utility to encrypt your original text file.
Jul 28 '20 #7
DGrund
23 New Member
1. Encrypt the file with the words. You may need to write a small utility to encrypt your original text file.
Understood. But do you have a little more direction? I can do C#, but I am new to encryption, especially one that I can decrypt in step3 below.

2. Import it into your exe
Understood

3. Include code in your exe to decrypt it when you access the text data.
If I can get step 1 working, I am sure I can reverse the process.
Thank you!
Jul 28 '20 #8
dev7060
639 Recognized Expert Contributor
If i know the keywords, i'd use a search engine to get to know the specifics.
Jul 29 '20 #9
DGrund
23 New Member
No kidding. Another useless "help". Did you chime in to scold me? Please don't "help" if you don't have anything constructive to contribute.
Jul 29 '20 #10
Rabbit
12,516 Recognized Expert Moderator MVP
You keep complaining about how no one's offering any help but it's also clear to us that you refuse to put in any effort into looking at the help already given.

If you had taken a minute to type rot13 into google, the very first result contains both a calculator that will apply rot13 for you, in addition to a link to the wiki page that explains how rot13 works.

The least you could do is click that first link in google to take a look at the calculator and read the wiki page that explains how rot13 works. If after that, you still have trouble understanding rot13, then we'd be happy to help further. For example, you could have replied with:

I read the rot13 article and it says I should do step x, y, z. But I am having trouble implementing step y. Here's what I tried to implement the steps but step y isn't working correctly. Where did I go wrong?
Jul 29 '20 #11
SioSio
272 Contributor
[Visual Studio .NET Tools]-[Dotfuscator Community Edition] has "String encryption".

Can it meet your request?
Jul 29 '20 #12
DGrund
23 New Member
Hmmm... I will research that. Thank you for the tip!
Jul 29 '20 #13
Banfa
9,065 Recognized Expert Moderator Expert
I can do C#, but I am new to encryption, especially one that I can decrypt in step3 below.
I understand that is why I am suggesting simple ciphers, like ROT13 because that will give you the idea of basics of encryption without having to get your head round the complex maths of the more complex encryption routines.

I was assuming you might look up ROT13 using Google or Wikipedia as I suggested, it is a simple Caesar Cipher. The basics of a Caesar is every letter is replaced by another letter if the alphabet using a fixed shift offset, i.e. for a shift of 4 A is replaced with E, B with F, C with G etc. Decryption is a simple matter of undoing the shift E is replaced with A, F with B etc.

Rather than shifting this can be thought of as rotation because if you are at the end of the alphabet you start again at the beginning i.e. X is replaced with B which in computer terms is a rotation rather than a straight shift, hence the name ROT.

ROT13 is a special case because you are shifting/rotating by 13 characters. Because this is exactly half the number of characters in the alphabet, 26, the say algorithm can be used for encryption and decryption

i.e.
DGrund Rotated 13 = EHsvoe
EHsvoe Rotated 13 = DGrund

These are not strong ciphers and are subject to a number of well known cryptographic attacks
  • Look a big bunch of text, spaced like words but I don't recognise any of them I wonder if a Caesar Cipher is in use?
  • Frequency analysis, because an E is always replaced with the same character the frequency of that character in the cipher text (the text after encryption) remains the same, since the frequency that E occurs in written English is known frequency analysis of the symbols in the cipher text can give clues about encryption used.

to main 2 there are others, I'm not a security expert. The first point can be addressed by using an extended character set so your text is no longer all letters and also encoding the spaces. This is all explained in the ROT13 Wikipedia article.

I didn't think this mattered in your case because you are just trying prevent someone taking a casual glance at the code of the application from being able to immediately see the words.
Jul 29 '20 #14
DGrund
23 New Member
I understand that a seasoned hacker can disassemble a .Net program, and get to anything I have written. A seasoned hacker would be bored and unrewarded here. All I want to do is keep the casual hack from seeing and using my word lists. I appreciate your in-depth analysis and reply. I have my work cut out for me now. Thank you so much.
Jul 29 '20 #15
SwissProgrammer
220 New Member
DGrund,

Please be patient with these people.

At a quick glance, everyone that answered you has already given you good usable answers, IF YOU TAKE THE TIME TO STUDY WHAT THEY SAID!

Here is a very simple example of how this can work.

(1)
In your text files that you are using (if so), replace each letter and each number with a different letter or number. Your choice. You do not need some (supposedly secure, but not) encryption algorithm designed by someone else that is already broken and crack-able by someone else. Just code a text replacement program (yourself) that replaces each letter and number, (one at a time) as I said. Read the text file into your program (If small enough in length, then use one string to hold it all); Parse the text file for each letter and number in that string one at a time; Change each letter and number one at a time and save to a second string; When done, save that second string to a file, and use THAT file in your resources that you send along with your exe. If you cannot do that then do not read any further and you need to learn to do that now.

Step 2 and 3, if you get so that you can do step 1, then you should have already learned close to how to do this backward and un-encrypt the included file. Of course each of your exe's will have the same encryption pad (and it will be used over and over again), but you can supply multiple versions of your exe's for variations. Also, you do not have to learn how to use anyone else's (supposedly but not secure) encryption algorithms.

Once you get to be able to do this, then you might have a greater understanding of what the other (far smarter than myself) posters have already told you.

I hope that this helps you.

post script:
You said, "I understand that a seasoned hacker can disassemble a .Net program, and get to anything I have written." That is very misleading and potentially damaging to someone later learning the truth. .Net is a JIT system. That means that it is a Just In Time compiled mess. It is designed intentionally to send the raw code along with whatever is sent including the exe. The exe that is sent is NOT intended to be used by the receiving computer. The raw code is to be used. It does NOT require a "seasoned hacker" to "disassemble a .Net program" as it includes ALREADY NOT-assembled code along with any exe that is sent, by DESIGN.

post post script:
I just now read your original posting again it suggests one of your possible problems.
"I am writing a word game, and my word lists are copied from an external text file during development time, and embedded within the program (the .EXE file). How do I hide these word lists from prying eyes who browse the .EXE file?
Thank you!"
"Embedded within the program (the .EXE file)" suggests that you are not sending along to anyone else an external text file. Meaning that it looks like you are saying that the external text file is compiled into the .EXE file, and thus not being sent along as an additional file.

If this is so, then you should not have to encrypt that text file, as it is not being received by the end user.

I say "should not" because I do not know C#, and what version that you are using, and what compiler that you are using, and what operating system that you are using, all of which might break the "should not" part.

Differently I say "should not" because I do not know by your original question/statement if you are using .net ,which as I explained earlier, is a JIT system and the supporting/original code which created a locally-usable-only .EXE is fully open to being read, line by line, command by command, by a receiving computer.

"How do I hide these word lists from prying eyes who browse the .EXE file?" suggest that you are not using a compiler that has the ability and/or that you are not using that compiler's ability to fully compile the exe. If you look at the exe, and if you see your text in it as you wrote it, then your options are: get a better compiler; or study how to use the compiler to obfuscate those texts in the exe; or scramble those text before you include them in your exe (as I described earlier in this answer) and make your exe to unscramble them itself automatically; or dump C# and use clean and secure C++11 as written by Stroustrup without all that .net mess and Visual Studio mess.

I hope that this is helpful.
Jul 30 '20 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1395
by: Angelos | last post by:
How can I get some data which until now are displayed in the URL and I retrive them via $_GET and I don't want them to be accessible from the User ? Specifically I am passing the path of a...
2
1603
by: Gellert, Andre | last post by:
Hello, I have following problem: A user "xy" shouldn't have any rights to a table, but needs data from the content of the table. My idea was to setup a PL/PGSQL procedure to fetch the data...
5
1927
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I am designing an app in VB 2003 (as a lot of you prob already know!) I have some code the queries an SQL Server CE Database and comapares the data retrieved to a letter the user...
11
5623
by: sofeng | last post by:
I'm not sure if "data hiding" is the correct term, but I'm trying to emulate this object-oriented technique. I know C++ probably provides much more than my example, but I'd just like some feedback...
162
10065
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
3
3280
by: yarivot26 | last post by:
Hi, I have a form where the user can select a product and the product info will appear next to it. The products and the data on them all come from a db so I needed it to be dynamically. ...
0
10707
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
1
2011
by: phil105 | last post by:
How can I show/hide the data table in an embedded chart of a form in MS Access(2003)? I want users to click a control rather than play with the chart I can find stuff on show legend but not data...
0
2033
by: muthulk2 | last post by:
this is my code i want to remove the row of id "14" and "24" foreach (DataRow d in dt.Rows) { if (d.ToString() == "14") { ...
3
1815
by: ektayadav | last post by:
I want to dispaly password column data in format "***" . How to do this security in sqlserver 2012
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.