LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-31-2006, 11:10 AM   #1
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Rep: Reputation: 15
protecting files


hello, i am currently writing a program and need to be able to store information to the local pc atfer each run of the program specific to the run. ie a count of time the times the program has been run. i could store this in a file but the user could reset the counter by copying an old version of the file and overwriting the current one at a later date. is there a secure way i can store this information so the user cannot change it(no matter how good of a hacker he is) but the program can? cheers
 
Old 12-31-2006, 11:27 AM   #2
namit
Member
 
Registered: Aug 2005
Distribution: Debian
Posts: 355

Rep: Reputation: 30
well not really sure what ya exactly want to do but you could do an exclusive or with a key and the info that your outputting and then when reading that in again you use the exclusive or again.

most simple cryptography or readup on a bit of cryptography
 
Old 12-31-2006, 11:28 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Surely there is not this is because..if something (for example, the program itself) can alter the file, then there is a way to alter the file and the problem is then to prevent any other user from using that way. And as you might guess, there is no way of doing this water-proof; if such a way existed (apart from not having the machine at all), we wouldn't need to worry about hackers or crackers. But we do.

You could set the bit who's-name-I-don't-remember, that prevents anybody from changing the file (was it "u-bit"?), and unset it while the program touches the file. This method, anyway, has the weakness that a mad hacker, a cracker, would only need to find a way to gain root privileges to breach your fine system. It might be difficult, but never impossible
 
Old 12-31-2006, 11:29 AM   #4
andystanfordjason
Member
 
Registered: Oct 2006
Location: england
Distribution: fedora 6
Posts: 38

Original Poster
Rep: Reputation: 15
basically, my problem is that anything i put in a file can be copied by the user. the problem i think i need to solve is can my program reliably detect if the user modified the file or the program did it. cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protecting tar files jayakrishnan Linux - General 3 01-13-2008 11:02 PM
DISCUSSION: Protecting Files Using Encrypted Containers XavierP LinuxAnswers Discussion 1 02-25-2007 06:23 AM
Protecting RAR files vegetassj2 Linux - Software 2 09-14-2006 05:59 AM
Password protecting specific files General Linux - Security 9 04-20-2006 04:26 AM
password protecting two files to two different databases on Apache? RKris Linux - Software 0 02-24-2003 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration