Short versionMy boss wants me to store user passwords for an ASP.NET Web Forms web app we're developing in clear text, so that a user with admin rights can click a button and get back the current passwords for the accounts she controls.I don't want to do that, because I deeply care about the security and privacy of users of a web app I am involved with in whatever way.What would be a good way to store the passwords in an encrypted form, that can still however be decrypted?I can't count on users having an email address, so sending the user a link to reset the password is not an option.Read the following for more context.Some contextThis app was written by individuals who have little clue as to how software should be written. Lots of duplicated code, risks for SQL injection everywhere, no unit tests whatsoever, one new connection gets instantiated and opened for each and every query... name a bad practice, you'll find it in this codebase.The passwords are currently stored as a simple MD5 of the original string, which is weak and horrible and everything, but still a tiny bit better than clear text.I just finished implementing a feature request where the admin I was talking about can click a button and have an account automatically created for each employee she manages, with a random password.I cringe while writing this, but one of the requirements was to export the credentials in an Excel spreadsheet. Which I did.This is bad in and of itself, but then my boss said What if the user loses the spreadsheet? Users are dumb, you know. There needs to be a way to get the passwords back.Bang.Getting him to listen to people who know what they're talking about is not an option, sadly.The obvious suggestion would be GTFO, I know, but rest assured that it's something I'll do as soon as I possibly can.Meanwhile, I need to cheat and pretend I store passwords in clear text, while I do things in the best way possible to protect my users' passwords.EDITFor some reason people answering are assuming I'm a girl so, just for the record, I would like to clarify that I'm a guy. Not that it should make any difference, but hey ;)
Storing web app passwords so that they can be retrieved
asp.net;passwords
If you must do this because you aren't being given an option, you might encrypt the passwords with a password that is not stored in the code or in the database.  Make the recovery 'by request' of the customer (they have to call you for it), and someone on your end would have to enter the password to re-generate the user/pass list.Don't fret over the stupidity.  You pointed out the more secure procedures, your boss ignored them.  It probably wouldn't hurt to get your objections in writing (email) in case there's a problem and they try to blame you.