How do I safely store a password in a file??
 

My program requires password to open some features. The password can be set by an administrator. My app stores the password in a file. But, if the file was deleted or damaged, the app loose the password. Another scenario is if the file was replaced with original file then the password will be empty. Any suggestions about storing a password in a file?

edited : My app has a feature. The feature is protected by a password that can be set by a admin (owner of the PC). Guest should enter password to disable that feature. OS : Windows

http://www.stackoverflow.com/questions/3785577/

        

There are 2 answer(s) to this question.


You can't protect the file from being deleted. In that case just don't allow any user to log in to your application (same applies if the password is empty).

If you store passwords in a file (or anywhere really) you should hash them (e.g. using md5 or sha1). So they can't be read in plaintext. To check the password during login just do (basic example in php):

$password = file_get_contents('password.file'); // Outside webroot of course
if(md5($_POST['password']) == $password) {
    // Login OK
}

What kind of program ? Which platform ? Windows, mac, linux, android ?

Files can always be deleted or replaced, one way or another. You can put it somewhere "safer" where the user can't find it easily, but if depends of the platform.

Related Questions

Related password protection Video tutorials from Youtube.


ESET NOD32 Antivirus 4 + Seria
ESET NOD32 Antivirus 4 Free + Serials for life 1. download ESET NOD32 Antivirus 4 from thepiratebay.
ESET NOD32 Antivirus 4 + Serials
ESET NOD32 Antivirus 4 Free + Serials for life 1. download ESET NOD32 Antivirus 4 from thepiratebay.org (thepiratebay.org or from ESET website (www.eset.com 2. install either one and enter serials to register up to a certain date Username: EAV-40506477 Password: sccfxbnv4t Expiry Date: 4/25/2011 3. When license expires, simply go to hhuu.net for new licenses that are constantly updated Tip: ESET may block hhuu.net when you try to go to it, if this happens just temporarily disable ESET to get a serial, then enable protection again. Enjoy and feel free to comment with any questions or tips! Tags: ESET eset NOD 32 antivirus 4 keygen serials username password virus protection code serial crack piratebay legit official lifetime for life updated security free torrent download slideshow educational downloads "graphics software" laptop charts hacking "new single" technology computers programs full version

Protect Your Mac From SPIES! -
Want to lock your Mac with a single shortcut, including password protection? On today's Tekzilla Dai
Protect Your Mac From SPIES! - Tekzilla Daily Tip
Want to lock your Mac with a single shortcut, including password protection? On today's Tekzilla Daily, Veronica shows you how to do just that, without third party software!

ESET Nod32 Antivirus 4 Usernam
1. DOWNLOAD: tnij.org or fastyshare.com or sharecash.org 2. Run program and click Create Key (userna
ESET Nod32 Antivirus 4 Username & Password 2011
1. DOWNLOAD: tnij.org or fastyshare.com or sharecash.org 2. Run program and click Create Key (username + password) 3. Enjoy! ESET products remain the best virus protection available in 2010, whether it's ESET NOD32 Antivirus or ESET Smart Security (built with the same ThreatSense® engine as ESET NOD32 Antivirus). Direct comparisons, including competitive, detection and performance advantages against other antivirus solutions tell the story better than we ever could. ESET NOD32 Antivirus uses a powerful combination of advanced heuristic technologies and automatic updates of malware signature databases, detecting and eliminating a rapidly growing number of unknown threats. Make your online experience safer. Enjoy all your favorite online activities, including sharing music, video, and other files with your friends, while protected by ESET's award-winning technology, now uniquely engineered for the Mac platform. Includes complimentary online Mac safety training. Gamers have always been particularly vulnerable to attacks because of their prolonged online activity and use of peer to peer networks. But now that you are being specifically targeted by phishing scams and password stealers, protection has never been more important.

Citysoftware Lacie 1TB Network
www.CitySoftware.com.au Anthony Gives a Demonstration on the LaCie Network Storage 1TB Go To: www.ci
Citysoftware Lacie 1TB Network Storage Product demonstration
www.CitySoftware.com.au Anthony Gives a Demonstration on the LaCie Network Storage 1TB Go To: www.citysoftware.com.au For more details. Lacie 1TB Network Space Features: Remote FTP Local Network Storage Password Protection Media Streamed directly to your Xbox 360, PS3 , Media Player. Cost Effective solution for all Home's & Small Offices.

C++ Programming Tutorial 4: Pa
This is how to password protect your program. If you don't get how to do certain things in the video
C++ Programming Tutorial 4: Password Protected Program - Easy
This is how to password protect your program. If you don't get how to do certain things in the video, watch the previous tutorials. Source Code: www.mediafire.com

Javascript Tutorial 1 - Passwo
A very simple script for password protection. Don't use this for highly sensitive information - it's
Javascript Tutorial 1 - Password Protection For Your Webpages (HD)
A very simple script for password protection. Don't use this for highly sensitive information - it's not completely secure, though it will stop any novices from gaining entry to your page. Here's a link to the script: www.tutorialforums.freeforums.org ---- www.dreamwarez.co.uk

Keka Mac App
In this video I'm introducing an application I found recently called Keka, and it offers more advanc
Keka Mac App
In this video I'm introducing an application I found recently called Keka, and it offers more advanced extraction and archival techniques when compared to other applications such as the unarchiver in Mac OS X. It offers splitting archived files as well as the reverse, lets you archive into a number of file types when compared to the built in finder archiver, which only archives into zip format. Password protection is also a feature, and best of all (I forgot to mention this in the video) it's completely free! Growl support is built in, which is quite useful. You can find the app here: www.kekaosx.com You can find me on twitter at www.twitter.com/picotweet and my blog's at www.picotweet.blogspot.com By the way when I was spelling out the URL I said "x" in the video since I'm referring to the letter "x" and not "mac os ten." Thanks for watching.

Data Privacy: Your Digital Lif
www.SafeHouseExplorer.com A hilarious and whimsical satire about the perils which can befall our per
Data Privacy: Your Digital Life
www.SafeHouseExplorer.com A hilarious and whimsical satire about the perils which can befall our personal and private information in this digital age when we don't take steps to protect it using free encryption software for hard disks, Flash drives and USB memory sticks. SafeHouse Explorer is free encryption software for Windows which can password protect and hide your secret files on any hard drive or memory stick. Super simple. Nothing to learn. Just download and start using it.

Antivirus Software Tech Suppor
Software CD page: antivirus-software.tech.officelive.com antivirus-software.tech.officelive.com The
Antivirus Software Tech Support
Software CD page: antivirus-software.tech.officelive.com antivirus-software.tech.officelive.com The Total Internet Security CD is a service we provide for website visitors who would prefer to have an installation CD rather than doing all the downloads online, and like the idea of having tech support when needed. All of the software you need to give your computer real protection from virus infections, spyware, adware, trojans, etc. is on this CD. A good firewall and other effective tools to protect your online privacy are included, with protection against fraud, phishing, scams, keyloggers, and hackers. You will have a selection of over twenty top rated security products to choose from. This is permanent software, not some trial version that you have to pay for later.* We have included the best software products tested by independent labs and security experts. Any software that we send you also had to pass our tests for quality and effectiveness before we approve it. 1. Five top rated antivirus products. You get to use the one you like the best for as long as you want. 2. Five of the best anti-malware products. 3. Three of the most secure firewalls, so you can use the one that works best on your computer. 4. The most secure web browsers for Windows, plus security ad-ons. 5. Your personal privacy sheild and password encrypting tools. 6. Anti-fraud and anti-phishing filters for your web browsers. 7. A tune up utility for your computer. 8. Easy installation instructions ...

Post you comment here

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

There are 0 comment(s) to this page.



The questions and answers taken from stackoverflow.com's public data dump which is licensed under the cc-wiki license.
Logo, website design and layout ©2011 CodingTiger.com