Re: Encryption Question



On 14 Mar, 22:21, "Richard Cornford" <Rich...@xxxxxxxxxxxxxxxxxxx>
wrote:
Bart Van der Donck wrote:
<snip>



One-way encryption from client on beforehand is secure
to change the password on one Conditio, which is that
the user must know the previous (encrypted) password.

E.g. if one posts the following to newpass.php:
oldEncPW=gH4tGhKLNx
newEncPW=yHjke4c5Wu

Then compare the old (stored) string to the sent
'gH4tGhKLNx'. If it matches, replace it by 'yHjke4c5Wu'.
No encryption needed at server side, and safe if it goes
over HTTPS.

(One common alternative that comes to mind is to use a
cookie where the old password is stored, so the user doesn't
need to retype it when he requests to change it.)

Isn't the problem with sending the password in plain text over HTTP that
someone may intercept the traffic and so acquire the password for later
use in gaining access that they are not entitled to?

However, if a 'hash' of the password is sent in plain text over HTTP, and
all the server knows is the 'hash' of the password, has the situation
really changed? What is to stop someone who knows the 'hash' of the
password inserting it into the appropriate location in an HTTP request
(by any of numerous means, including the executing of alien javascript on
the logon page)? Wouldn't the server recognise the intercepted 'hash' as
easily as it may have recognised the original password?

The advantage of HTTPS is that someone intercepting the HTTP traffic is
not going to find it easy to make any sense of what they observe.

Richard.

yes I fear that this is NOT secure. Take for instance the condition
that the user knows the previous password. The old password is stored
in the mysql database as SHA1 hash. (let us say for argument's sake
the old password was 'fred' and that the new is 'newpassword'
so the database contains the sha1 hash
$db_data = sha1('fred')
now the user typed in fred which with a salt was sha1'd by the client
and sent to the server.
js-> sha1(salt+sha1('fred'))
then sends this as hashed_data
the server must check that the user entered fred, but can only do this
by copying the procedure
server-> sha1($salt . $db_data ) and seeing if it is equal to what was
in the $_POST var
$_POST['hashed_data'].

Now what you are proposing is that the server checks this and when the
user has indeed verified that they know the old password, you then
_replace the old hash with sha1('newpassword')

now anyone listening to the traffic as Richard says now knows the new
hash they have eaves dropped
sha1('newpassword')

so the attacker just requests the logon page, gets given a new salt
and can now send this POST data (using some proxy or other or a header
editor)
$_POST['hashed_data'] = sha1( newsalt+sha1('newpassword') )
the attacker doesnt need to know the password.

The server accepts this and compares it against the database entry by
the smae method as before
server-> sha1($newsalt . $new_db_data )
where $new_db_data is sha1('newpassword')

they match and the attacker gets in


This shows that there is no security in sending the sha1(password)
where this string will then be directly stored in the database. I for
one _never use_ one way hashing to *change* passwords, only to
authenticate an existing one which *can* be secure I agree with you
there!


.



Relevant Pages

  • Securing a website...storing hashed passwords?
    ... security for a web site that presumably won't have an SSL option. ... The server will supply a random value to a login page. ... with the random value and create an MD hash. ... database are obviously a nono. ...
    (comp.security.misc)
  • Re: Securing a website...storing hashed passwords?
    ... The solution is to compute the hash of the candidate password, ... That final hash is sent to the server. ... presumably in a database - but cleartext pw's in the ... > database, I have a key management issue, eg storing either a symmetric ...
    (comp.security.misc)
  • Re: Connect to table on web
    ... You can do this using the RealThinClient SDK: compile your own Web Server, ... communicate with your Server over HTTP, ... RTC DB components are currently in beta testing (beta is free to all ... Server to serve your database over the Internet is as easy as placing a few ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: OleDbCommand.ExecuteReader Performance
    ... Okay --- even in a web based environment, your server is what holds the ... server and your oledb database is. ... Won't it be terrible slow? ... > because it seems that each time I call OleDbDataReader.Read, an HTTP ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to access to a DB in an NT domain.
    ... I must using a database that resides in a NT Server and my application ... Can you open the database from a file share on your server or do you have to use HTTP? ... If you need to use HTTP and RDS then I would make certain that your server has been configured ...
    (microsoft.public.vb.database.ado)