I'm developing an ASP.NET web site for some small business. The site needs a password-protected area where the site owner will manage the site content. For the rest of the world, the site is completely read-only.
I've designed and implemented the following scheme:
- A user wants to access some protected page.
- Every protected page inherits "AdminIface" master page, that alters the UI so that user knows he's on a protected page, and checks the security cookie. If no cookie or wrong cookie: redirect to auth.aspx.
- Auth.aspx generates a big random number using RNGCryptoServiceProvider, then sends it to the client + password form.
- User enters the password.
- Client-side JavaScript combines random seed + password, calculates MD5 of the resulting string, posts MD5 to the server.
- Server compares the random seed with the value hold by Session, if OK it combines random seed + password, calculates the MD5, compares MD5.
- If the checksum matched – the server generates one more big random number to be used as a security cookie.
- Server stores the security cookie in Session object, and sends the cookie to the client who's now considered authorized.
The correct password is stored as a string constant in the auth.aspx source.
Is this scheme OK?
P.S. I know AD+Kerberos is much better, however on the godaddy's shared hosting I've got no privileges even to create one more application.