954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to keep text file from user

I m a beginner. Using open source, I have compiled a freeware Eng-Hindi dictionary in C# with a 40K word data input source as a Text file. Is there someway to modify / hide the said Text file from front end user. Thanks.

buyap
Newbie Poster
5 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

buyap,

Implement Cipher (encryption/decryption) system.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

I don't understand the question :| adatapost how could you :) I think they need to develop and editor to this file to add\modify\remove some words.

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

I guess it from this text "hide the said Text file".

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Yeah I was thinking the same thing adatapost was.

buyap -- You can see an example of encrypting strings on http://www.daniweb.com/code/snippet1244.html . You can slightly alter that code to use streams

sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 

....

buyap
Newbie Poster
5 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Thankyou, I m a beginner. My native translation work(55K+ words) for dictionary is aimed for native user translation convenience. But text data reuse by native developers may cause multiple ditto copies so original translator not distinguished. I have tried encrypted file but goes unreadable by program. By whatever suitable means, how to make text file unutilizable by distrubution content recipient. Thanks & Regards.

buyap
Newbie Poster
5 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

buyap,

Try to get solution with same thread. Do not create new thread for the similar question.

Duplicate Thread --
http://www.daniweb.com/forums/thread201557.html

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

1. If you want to hide the file visually then modify the file's properties to 'hide' the file its self.

2. If you don't want the user to access that file and make use of the data stored within it then do what was previously mentioned, Encrypt the file and when the program needs to use/load the file you would then Decrypt the file and then feed that data to the program. And to take an extra precaution that will keep most(not all) users from seeing the file. Follow step #1

And please dont double post: http://www.daniweb.com/forums/thread201557.html

Poab9200
Light Poster
35 posts since Aug 2008
Reputation Points: 16
Solved Threads: 1
 

i think you can embed that text file into your applications executable. so they can not see the content.

serkan sendur
Postaholic
Banned
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
 

have a look at the attached for encrypting-decrypting your text file.

Attachments Security_-_Encrypt_and_Decrypt_Data.zip (109.17KB)
serkan sendur
Postaholic
Banned
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
 

Thanx serkan, its a simple nice solution I embedded txt file as well which should have worked but .NET framwork exception says program cant find txt file on path ...\... \desktop\data.txt (path where application.exe was clicked to run). Can you suggest how can we make application.exe find txt file on path expected by program (to read it) which should be a simple & preferred solution OR any other solution than one you suggested. Thanks again.

buyap
Newbie Poster
5 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Use Application.ExecutablePath property.

String path=System.IO.Path.GetDirectoryName (Application.ExecutablePath) + "\\data.txt";
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

to get the application path refer to this thread
http://www.daniweb.com/forums/thread196784.html

serkan sendur
Postaholic
Banned
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
 

Thanx to all! I have tried both solutions but as mentioned, being a beginner, I couldnt make it work, implement within project. Anyone please can provide with a small demo working example of either "embedding the txt file & modifying application path in prg. code" or "implement encrypt-decrypt to make txt file human unreadable( application readable) within the project" in order to make txt file either hidden or unreadable by end user etc. After your reply this thread needs to be closed, whether solved or unsolved (before dan's admin delete it) Thanx again.

buyap
Newbie Poster
5 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

Try this

Attachments encryptDecrypt.zip (22.62KB)
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You