473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Password hashing question...

I need to store a password for use later in my web app and
I would like to use FormsAuthentication.HashPasswordForStoringInConfig File.

The question is, once it's hashed and stored, do I need to
unhash it to pass to windows for authentication? Or can
I set something in Web.Config that will do that?

I haven't found any documentation that points me to what to do
next.
Feb 14 '07 #1
5 1893
Joe <Jo*@discussions.microsoft.comwrote:
I need to store a password for use later in my web app and
I would like to use FormsAuthentication.HashPasswordForStoringInConfig File.

The question is, once it's hashed and stored, do I need to
unhash it to pass to windows for authentication? Or can
I set something in Web.Config that will do that?

I haven't found any documentation that points me to what to do
next.
You can't "unhash". A hash is a one-way conversion. The point of
hashing is that you can store the hash with no security risk - you can
hash what the user provides later on, and if the hashes match, the
password is (at least very probably) correct.

Storing the password as a hash is no use if you need to be able to
provide the plaintext password to another application at another time,
however.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 14 '07 #2
Jon,

Thanks for the reply. I should have remembered that hashing is one way.

So, is there anyway to securely store a password in memory? The way
the app is written, each time an action is performed a DirectoryEntry
is created and then the actions are performed (create/delete user, modify
group membership...).

We are using Forms Authentication and do not want to use Integrated Auth.

Thanks for the thoughts.

"Jon Skeet [C# MVP]" wrote:
Joe <Jo*@discussions.microsoft.comwrote:
I need to store a password for use later in my web app and
I would like to use FormsAuthentication.HashPasswordForStoringInConfig File.

The question is, once it's hashed and stored, do I need to
unhash it to pass to windows for authentication? Or can
I set something in Web.Config that will do that?

I haven't found any documentation that points me to what to do
next.

You can't "unhash". A hash is a one-way conversion. The point of
hashing is that you can store the hash with no security risk - you can
hash what the user provides later on, and if the hashes match, the
password is (at least very probably) correct.

Storing the password as a hash is no use if you need to be able to
provide the plaintext password to another application at another time,
however.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 15 '07 #3
Can I ask why you do not want to use Integrated Auth here - it would be
perfect.
Feb 15 '07 #4
Hi Joe,

no, there is no way to to securly store date your program has to read. You
only can try to divide the information neede to restore the data.
E.g. if you encrypt the password, the programm will need the key to encrypt
it. A hacker, wich has acces to both, the encrypted passsword and the key,
can easy decrypt the password.
You also can try to obscure the way, the data is encrypted. But still, all
information for this will remain in the program plus some store, the program
has access to.

So, there are some ways, to make it more difficult to hack the password, but
not to make it impossible.

The question is, how much is it harder, to access all thoses stores than to
access only a part of them.

Christof

"Joe" <Jo*@discussions.microsoft.comschrieb im Newsbeitrag
news:74**********************************@microsof t.com...
Jon,

Thanks for the reply. I should have remembered that hashing is one way.

So, is there anyway to securely store a password in memory? The way
the app is written, each time an action is performed a DirectoryEntry
is created and then the actions are performed (create/delete user, modify
group membership...).

We are using Forms Authentication and do not want to use Integrated Auth.

Thanks for the thoughts.

"Jon Skeet [C# MVP]" wrote:
>Joe <Jo*@discussions.microsoft.comwrote:
I need to store a password for use later in my web app and
I would like to use
FormsAuthentication.HashPasswordForStoringInConfig File.

The question is, once it's hashed and stored, do I need to
unhash it to pass to windows for authentication? Or can
I set something in Web.Config that will do that?

I haven't found any documentation that points me to what to do
next.

You can't "unhash". A hash is a one-way conversion. The point of
hashing is that you can store the hash with no security risk - you can
hash what the user provides later on, and if the hashes match, the
password is (at least very probably) correct.

Storing the password as a hash is no use if you need to be able to
provide the plaintext password to another application at another time,
however.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Feb 15 '07 #5
"Joe" <Jo*@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
Jon,

Thanks for the reply. I should have remembered that hashing is one way.

So, is there anyway to securely store a password in memory? The way
the app is written, each time an action is performed a DirectoryEntry
is created and then the actions are performed (create/delete user, modify
group membership...).

We are using Forms Authentication and do not want to use Integrated Auth.
Update actions performed on an AD require "Domain Admin" credentials, your clients,
connected over the internet, aren't (shouldn't be) Domain Admin's they shouldn't even have
access to the AD.
That means you should use different identities/credentials for the web access and the
resource access. So, first you'll have to "validate" the web client credentials against a
custom "Identity Store", and once the client is validated, you'll have to switch context to
access the directory. As "Identity Store" you can use a private LDAP, a DB store or the AD,
the choice highly depends on the number of clients and your security requirements.
Once the client is authenticated, you can access the AD using "explicit" credentials being
these of a domain admin, so you have to make sure they 1) are taken from a *safe* location,
2) they aren't kept in memory for a *long* period.
A much better option is to have your AD application code in a System.ComponentServices
derived class and registered as a "Server Type" application in the COM+ catalog. The COM+
application should run in a account having "domain admin" privileges.

Willy.

Feb 15 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil Latio | last post by:
I am trying something very simple, to pass the contents of a form (just username and password) to execute a query on MySQL table. The problem appears to be the password field. For example,...
4
by: chuy | last post by:
Is there a way to recover a lost password in Mysql 4.1. I have seen many articles and howto's on how to kill the Mysql process and then restart using skip grant tables option. I am not trying to...
2
by: ChInKPoInt [No MCSD] | last post by:
1. Is there anyway to preload password? Text attribute doesn't work <asp:TextBox ID="Pass" TextMode="Password" Runat="server" Text="Hello"> 2. In the same form, if other elements such as...
4
by: Guadala Harry | last post by:
Looking for recommendations for *credible* information on implementing password hashing and salting. I did my own search and came up with a bunch of somewhat contradictory often...
0
by: Brian | last post by:
Thanks for your time. When a hashed password is stored in a db - how should it appear in the table? In the MySQL table I'm using to store username and passwords, it appears as system.byte. ...
4
by: Jon | last post by:
I have a requirement for a new product that the user's passwords cannot contain a word found in the dictionary. I don't really have any practical ideas on how to do this. What's the best way to...
0
by: =?Utf-8?B?QW1qYWQ=?= | last post by:
I have one question about forget password control with asp.net 2.0 we are using here Groupwise . how can i send email using group wise instead of SMPT and how to change the setting for or i have to...
1
by: Tom | last post by:
Ok, I took over a web app that is using the login control provided by asp.net 2.0. In the config file the developers added a param as such: <machineKey validationkey=" and a hole mess of letters...
6
by: kmd | last post by:
Hi I make simple script and ive made admin panel. Login and password are in config.php file. Im using form to log in. And my question is: Is security of this code high or low or medium? :) In...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.