HTML5 Canvas
Written by: Simon Sarris
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Web Driver
  3. MVVM
  4. REST
  5. ADO.NET
  1. HTML5
  2. Ajax
  3. jQuery Selectors
  4. CSS Part 1
  5. Git

Link Details

Link 104310 thumbnail
User 219690 avatar

By asgeirn
via blog.asgeirnilsen.com
Published: Aug 18 2008 / 04:38

The majority of personalized web sites use some kind of form-based password authentication where you have two form fields for username and password, and a login button. When you submit your authentication, the password is sent to the server for verification against a user database. This method has several security implications, and my article describes a possible solution to this, using JavaScript.
  • 13
  • 4
  • 2176
  • 0

Comments

Add your comment
User 233461 avatar

antych replied ago:

1 votes Vote down Vote up Reply

Pointless, just use SSL and one way encryption with random salt server side.

User 219690 avatar

asgeirn replied ago:

0 votes Vote down Vote up Reply

antych,

Many sites probably employ SSL, but SSL has its shortcomings as well. You still have to trust web developers to use one-way encryption in their database, but my experience proves many don't. I've received account confirmations with clear-text passwords countless times.

One other tell-tale is that the site's "forgot password" feature actually mails you your current password instead of generating a new one or a one-time change password link. This has also happened to me several times.

My suggested solution is client side. Therefore you do not need to trust the web developers to store the password securely -- you can check the scheme they employ in the HTML code.

It is also very non-intrusive to the rest of the web application, since the hashed password could be treated just like the regular password. For may webapps you would only have to change the HTML for the login page and the database table storing the password (to ensure that it has enough room for the SHA256 string).

User 233461 avatar

antych replied ago:

0 votes Vote down Vote up Reply

If those developers don't know how to store passwords, what makes you think they will read your blog and implement this idea?
You suggested a new technical solution for incompetent people who don't know an already existing, proved and widely used one. Can you see how your logic is flawed?

User 219690 avatar

asgeirn replied ago:

0 votes Vote down Vote up Reply

I think you miss my point. My solution increases security without any other change than the login HTML page and one database column definition. Adding SSL or encryption in the database access code requires significant changes to the web application.

SSL also adds cost and complexity in form of certificate issuing costs, certificate renewals and private key storage.

User 254327 avatar

xcdesz replied ago:

0 votes Vote down Vote up Reply

He explains the vulnerabilities -- and they are major ones. Better to try an RSA-type encryption strategy for authentication, though a bit more comlicated.

User 219690 avatar

asgeirn replied ago:

0 votes Vote down Vote up Reply

xcdesz,

How would you envision an RSA-type scheme? One key pair for each user account? Where should the key pairs be stored?

SSL has supported this for ages -- client-side certificates -- but hardly anyone uses them. The main reason for this is certificate and key distribution and management. It's hard to do right.

I considered using RSA for my solution as well, but decided on SHA256 for simplicity. An RSA-based solution would require a public key stored in JavaScript and a JavaScript RSA implementation. The benefits for this solution has to be weighed against increased complexity and reduced performance.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.