Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Protect password data with encryption

Posted on 2012-12-21
8
Medium Priority
?
864 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 80

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 80

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
LVL 80

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 80

Accepted Solution

by:
arnold earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

971 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