in reply to CGI and saving passwords

Without CGI::Session you have

With CGI::Session you at least avoid the second part. And if you have readable passwords in one place, one more place won't make that much of a difference.

No matter how you slice it, your apache process must be able to read the passwords to verify them. And it must be able to read your script. So even if you encrypt your passwords to protect them, the bad guys can just read your script, and use that to decypt the passwords.

Face it: you can't secure passwords on a server where other people have root. Root, if no-one else, can read everything.

You have to make a weighted decision: are your passwords valuable? If they are, get your own server, and be the only one with root. If they aren't worth the cost of a separate server, perhaps no-one will bother getting an account on that exact shared server just to steal your passwords.

Just one caveat (I know it's not what you're asking, but it's worth mentioning): Do not ever accept credit cards (or Ghu forbid store credit card info) on a shared server. Because that is just asking for trouble.

Get your own server, or have the CC transactions handled by a merchant service, but if you're on a shared server, don't do it yourself.

Replies are listed 'Best First'.
Re: Re: CGI and saving passwords
by sgifford (Prior) on May 04, 2004 at 03:24 UTC
    No matter how you slice it, your apache process must be able to read the passwords to verify them. And it must be able to read your script. So even if you encrypt your passwords to protect them, the bad guys can just read your script, and use that to decypt the passwords.
    No, passwords can be "encrypted" with a one-way hash function, like crypt(3) or MD5. That's how the Unix /etc/passwd file works. The plaintext password are hashed and compared with the stored encrypted password.
Re: Re: CGI and saving passwords
by JoeJaz (Monk) on May 04, 2004 at 04:23 UTC
    That's very helpful. I guess I'll take the time to refine the CGI::Session implementation considering that it will afford me a bit more security. I guess there is no foolproof way to be totally secure in this situation... but my passwords in this case are not top secret. Good to know about the CC transactions. Thank you very much for your help.