Take a look at
http://www.tonymarston.co.uk/php-mysql/encryption.html which
describes a reversible encryption routine for PHP. There is an online test
harness so you can see it working, and you have access to the code as well.
HTH.
--
Tony Marston
http://www.tonymarston.net
"Joshua Beall" <jbeall@donotspam.remove.me.heraldic.us> wrote in message
news:_tAic.65561$L31.5100@nwrddc01.gnilink.net...[color=blue]
> Hi All,
>
> Up until now I have been storing passwords in the database as an sha1[/color]
hash.[color=blue]
> I like doing it this way, but a problem arises with people who forget[/color]
their[color=blue]
> passwords - I cannot retrieve it for them.
>
> The simplest option would be cleartext passwords. Easy enough. But what[/color]
I[color=blue]
> would prefer to do is some sort of two-way encryption, so I can encrypt[/color]
the[color=blue]
> passwords, store them in the database, and then get them back. Are there
> any PHP libraries out there that can do this? I have thought about[/color]
rolling[color=blue]
> my own, but do not want to duplicate somebody else's effort.
>
> A cursory look for this sort of thing returned only one-way (hashing)
> encryption techniques. This leaves me back where I was, having to reset
> users passwords, rather than emailing it back to them.
>
> I am not running a banking application here, so I am not too paranoid[/color]
about[color=blue]
> security. But, it would be nice to have some reasonable level of[/color]
encryption[color=blue]
> that is harder than rot13 to break.
>
> Thoughts?
>
> -Josh
>
>[/color]