Solved

Protect password data with encryption

Posted on 2012-12-21
8
852 Views
Last Modified: 2012-12-27
Hello - first question on here.

I have a web database application in which I want to store passwords, but I do not like the idea of storing them in plain text. I would like to store an encrypted form of the password, and have users enter a password or key, when they need to view the password.

I can trigger a workflow in the database, which can pass stored or entered text to a URL in the form of URL parameters. For example, in a form in the application, the user sees an encrypted view of the password, and the form has a button, say [Show Password]. When [Show Password] is clicked, the app requests a key or password from the user, and passes it and the encrypted password string to an URL, where it is decrypted. The password is then shown, say in a popup.

I have a feeling that it might be more secure to use a client-side program, say javascript, which does the decrypt work.

The most basic form of this would be to have a key that is shared amongst users. That too is not very secure because of course people will share the key with someone they are not supposed to. Ultimately it would be great to use some kind of "what you have" 2-factor authentication, where the system requests a one-time-password that you enter via a Yubikey or a system like Duo-Security.

So my question is, does anyone on here have experience in these matters, to give me some general direction? Appreciate any advice, thank you in advance.

Sincerely,
Rick
0
Comment
Question by:Rick Cogley
  • 4
  • 4
8 Comments
 
LVL 76

Expert Comment

by:arnold
ID: 38715017
Question, why would a user need to see the password they used to login?
The process you should consider is using a one way encryption, I.e. the user submits the plaintext password that is passed over a secure connection, within your app or on the database you use the encrypted password as the key to encrypt the plain text the user provided. If they encrypted and the store match, the user
'Encrypted','password' with the result being 'Encrypted'. User authenticated/authorized.
If the user forgets their password, you would use forgot password where the user will need to provide info to validate their identity and send them a link that will let them set a new password. This way you eliminate the need to maintain a key and a password since you may still run into the situation that the user forgot their password and forgot their key which gets you back to the same point of how to get the user to verify their identity and the process you would need to include to reset/create a new set of as sword/key.
0
 
LVL 1

Author Comment

by:Rick Cogley
ID: 38715024
Hi & thank you Arnold - they don't; the passwords I want to protect are not the users' normal login credentials, but rather other ones they need to know to perform their daily activities. I guess a more generic idea would be to say I want to protect data in a database field, by encrypting it, and providing some means to decrypt, using something the user has.

Does the "one way encryption" you mention apply in such a case?
0
 
LVL 76

Expert Comment

by:arnold
ID: 38715033
One way encryption usually does not lend itself to decryption.
You could use a common key access to which is control through user rights.
I.e. usera logs I and wants to see password A, a check is run to see whether usera has rights to view this password. If the user does, the process pulls the key and use it to decrypt the password. The difficulty you ay run into deals with the process of key changes.
Note that a user that can see the encrypted form and then the decrypted form, can reverse the process to derive the key.
What is the environment in which this work is, using smartcard, certificate, NTLM based authentication an option?
0
 
LVL 1

Author Comment

by:Rick Cogley
ID: 38715051
I see. The db and app are on a hosted SaaS solution, so it is not NTLM etc. I can trigger the passing of entered and stored data, to an URL on another server that I set up, though. So I guess that means I could have a solution that uses Yubikeys or Duo-Security's smart-phone based solution.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 76

Expert Comment

by:arnold
ID: 38715557
You could use encryption with keys based on user provided information, but you have to make sure that when a user changes those parameters, that you go through the compete decrypt/reencrypt.
0
 
LVL 1

Author Comment

by:Rick Cogley
ID: 38725627
Thank you for trying to help. Let me get to the basic question: Is there any technology available to encrypt a string with a master key of some kind, and be able to decrypt it using something users possess, like a Yubikey?
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
ID: 38725660
I do not believe so.
You could do what you want by maintaining two sets of data.
one column will be the password encrypted with your master key, while the other will be encrypted with user selected parameters.

This will be true as well if you combine the two in a single column
i.e. password encrypted
with masterkey resulting in 345432345245235
with userprovided data results in dsfudspewjrew09
you would decide on what characters/can never occur and use that
i.e.
#@15#345432345245235$$#15$$dsfudspewjrew09##
and storing that as the string.
Then when the user tries to access, you would split the column data accordingly and run the decryption.
0
 
LVL 1

Author Closing Comment

by:Rick Cogley
ID: 38725752
Thanks! I can work with that idea!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now