LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2016, 10:55 AM   #1
teapottwo
Member
 
Registered: Sep 2013
Posts: 52

Rep: Reputation: Disabled
Password Manager concepts


I was reading a thread on here recently which reminded me of a conundrum.

Basically, how to store an actual password within a client application securely.

* I do NOT mean storing as a hash to be checked against!



How do password managers do it? Is that concept available across platforms (for me Linux, OSX, Windows, Android, ...)


Obviously I'm assuming the host system has been compromised (even if just parents or evil friend playing prank, etc)
 
Old 01-20-2016, 11:08 AM   #2
Nexusfactor
Member
 
Registered: Jan 2015
Distribution: Ubuntu
Posts: 50

Rep: Reputation: Disabled
Quote:
Originally Posted by teapottwo View Post
I was reading a thread on here recently which reminded me of a conundrum.

Basically, how to store an actual password within a client application securely.

* I do NOT mean storing as a hash to be checked against!



How do password managers do it? Is that concept available across platforms (for me Linux, OSX, Windows, Android, ...)


Obviously I'm assuming the host system has been compromised (even if just parents or evil friend playing prank, etc)
Was it perhaps this thread?

I posted this because I was working on a personal project and wanted to know how it was done. Hash was suggested, but you can look at the KeePass/Thunderbird source code.
 
Old 01-20-2016, 11:28 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Pass the salt.
 
Old 01-20-2016, 11:40 AM   #4
teapottwo
Member
 
Registered: Sep 2013
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Nexusfactor View Post
Was it perhaps this thread?

I posted this because I was working on a personal project and wanted to know how it was done. Hash was suggested, but you can look at the KeePass/Thunderbird source code.
It was that thread, and I did start looking into KeePass, but didn't dl the source / binary.

The wiki states this:
Quote:
Access to the database is restricted by either a master password or a key file. Both methods may be combined to create a "composite master key". If both methods are used, then both must be present to access the password database. KeePass version 2.x introduces a third option—dependency upon the current Windows user.
https://en.wikipedia.org/wiki/KeePass#Offline_security


So, in the original versions it either requires a password or keyfile, but they must be stored somewhere. (Same as Habitual's salt concept)

* TBH I'm not too interested into making this a service. So the startup and decrypting being linked to OS login isn't the way I'm looking, even though I'd be interested in knowing more about that mechanism.)


For a networked application I considered that when the password is initially entered it is sent to the server which returns a one-time code, and every time the user starts up a new code / token is issued. So if the code is stolen, when used twice would log out all parties forcing the original password to be re-entered. However, this does tie each user to a single device (and I am interested for games on one project which I'd like to be able to use multi devices, e.g. phone at work and tablet at home.)
 
Old 01-21-2016, 07:37 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Generally speaking, you don't want to store any kind of password. For that matter, you really don't want to use passwords for authentication, "period." Especially when an application is talking to a remote server.

The strategy that you should be using is: digital certificates, embedded as a simple resource within the application, and encrypted such that the application can decode it. The certificate, if possible, should be unique. If not, it should be easily field-replaceable. Existing crypto technologies such as Kerberos can provide the necessary infrastructure.
 
Old 01-24-2016, 12:06 PM   #6
teapottwo
Member
 
Registered: Sep 2013
Posts: 52

Original Poster
Rep: Reputation: Disabled
Once setup here's how I see Kerberos works (overly simplified, msg details ignored, timestamps, etc):

1. User uses own password to encrypt a msg to the KeyServer requesting authentication
2. The KeyServer generates a session key and secret, it then encrypts it with the users password and sends back to the user
3. The user decrypts the msg storing the session key and secret.

4. The User requests a Service Ticket by encrypting the request and secret with the session key.
5. The KeyServer replies with a new service session key and generates another msg for the Server containing the service session key, encrypting it with the Servers password
6. The User sends the msg for the Server to the Server.
7. The Server uses its own key to decrypt the msg from the KeyServer via the User
* The User and Server now share a service session key


* It appears that the User password is unlocked when the User logs onto their physical machine, it is then stored in volitile ram

So, it comes back to using the operating systems login and associated services to store the keys.


I'm not really considering the key exchange protocol here, moreover how to store a password or key locally in a secure fashion, without having to rely on the underlying systems' login




Quote:
Originally Posted by sundialsvcs View Post
..
The strategy that you should be using is: digital certificates, embedded as a simple resource within the application, and encrypted such that the application can decode it. ...
Yes, but how to store it securely independent of system login?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lubuntu: How can I change the password for the password manager? DJOtaku Ubuntu 11 03-22-2011 03:38 AM
Password Manager jstephens84 Linux - Security 1 05-09-2007 08:25 PM
Password Manager Sodrian Linux - Desktop 3 02-15-2007 12:35 AM
Password Manager doctorberen Linux - Software 1 11-23-2005 01:33 AM
Password Manager alphanumeric Linux - Software 1 06-28-2004 05:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration