LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to store password file so it could not be deleted? (https://www.linuxquestions.org/questions/programming-9/how-to-store-password-file-so-it-could-not-be-deleted-234572/)

softnayr 09-23-2004 11:02 PM

How to store password file so it could not be deleted?
 
I want to create a file encyptor in Turbo C which uses password. I can already encypt files and store password for the encrypted file. But the problem is how to store a password file so others could not delete it.

Is there anyone who can help me in my problem?

CroMagnon 09-24-2004 12:06 AM

(Turbo C? As in, for DOS?)

There's no way you can stop users from deleting files on their own PC. If you're using DOS, you could make the file read-only so it can't be accidentally deleted. Perhaps you could explain a little more fully what you want to do? Is the password file meant to be kept with the encrypted file? If it is, you could make it part of the encrypted file instead.

shrey_j 09-24-2004 08:26 AM

If you r in Linux, put your files in your home login folder, only root or yourself(or anybody having your password) will be able to delete your file.

In case you are doing it from root, then place it in root, no other haS access to this.

But in case somebody has root access, you cannot stop that person from deleting that file.

Also add . before the file name (.filename), which makes it hidden..sometimes quite helpful

regards,
Shrey...

softnayr 09-25-2004 06:44 AM

Tnx...
 
Thank you very much CroMagnon for your reply. But when i encrypt password together with the file, it is possible that users can decrypt the file though they cannot get the actual file if they input password even if it is not the correct one. Anyway, can you teach me how to encrypt files together with the password?

Tnx...

aluser 09-25-2004 01:04 PM

Is there something wrong with me, or is the point of encrypting a file that the user needs to supply the password himself in order to decrypt it?

lol, can you describe more precisely what you're trying to do? It might help in order for me or someone to suggest a better implementation.


All times are GMT -5. The time now is 06:30 AM.