Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure authentication without SSL

I'm starting to write a small web application and have started thinking about securing login (only used for administration).

If I could, I'd install a CACert or self-signed SSL certificate, since for now I'll be the only one logging in, but my host isn't too accommodating.

Are there any reasonable options for securing the site without SSL? I've been thinking about options for authentication:

  1. Implement a salted hash in JavaScript. When the login page is loaded, generate a salt server-side. Send it to the client in the clear and store it in a session variable.

  2. Digest authentication. I just found this idea browsing SO, and it's probably a lot more reasonable than rolling my own auth.

  3. OpenID. It's an open standard, no passwords are required (and I can "hijack" my OpenID provider's SSL to add security to the login process), but I have no idea how OpenID works or how secure it is. (Needs research. For example, can an OpenID authentication be replayed?)

The problem with all of these is that:

  • Sessions can be hijacked
  • Only login is secure, everything else is in the clear

The only option I can think of for securing the app after login is some disgusting JavaScript and PHP sending encrypted blobs of ASCII back and forth. I don't want to do this.

Is there any encryption (for pageloads and POSTs) that can be implemented in my server-side scripting language of choice without the blessing or involvement of my host, but that would be supported by the browser? Can sessions be secured from hijacking (practically) without SSL?

What would you do in a situation like this?

like image 992
s4y Avatar asked Aug 31 '09 05:08

s4y


People also ask

Is SSL required for SSO?

Yes, if you have configured SAML based SSO then we would have to have a SSL certificate for your vanity URL.

Is server authentication mandatory in SSL?

SSL-enabled client software always requires server authentication, or cryptographic validation by a client of the server's identity. The server sends the client a certificate to authenticate itself.

Can you use TLS without a certificate?

Without an SSL certificate, a website's traffic can't be encrypted with TLS. Technically, any website owner can create their own SSL certificate, and such certificates are called self-signed certificates.

Can you have HTTPS without TLS?

SSL/TLS enables you to deliver your site using HTTPS, which ensures a secure, private connection between your site and your users. If a site's URL uses http://, it is not secured with SSL/TLS. However, if it uses https:// it is secure — and you need an SSL/TLS certificate to make that happen.


1 Answers

You can securely authenticate without needing to implement protection against eavesdropping. For example, you can prevent others from sending requests, even though they can read the contents of your requests. If you need to protect against eavesdropping, I'd recommend just going somewhere where you can use SSL.

If you just need simple authentication without real security, your provider will probably support HTTP Basic. This (along with a good design which limits capabilities, and backups ;) is a reasonable interim solution while you worry about other problems.

For authenticating your identity, OpenID can't be replayed. Each authentication sequence is signed. However, OpenID by itself only lets you establish your identity with the server. It won't let you sign or otherwise authenticate a request. OAuth would, but it requires transport encryption for part of the protocol.

You could sign each request with a shared secret. This would prevent an attacker from submitting or replaying a request, but the requests themselves can still be read by an eavesdropper. See the documentation for Amazon AWS authentication (which includes client libraries) or flickr's authentication. The basic protocol is:

  • require a timestamp (and probably a nonce) as request parameters
  • normalize, sort, concatenate all request parameters
  • concatenate with URI, host, verb, etc.
  • hash with secret key
  • send hash in header with request
  • server does the same and compares signature
like image 137
Karl Anderson Avatar answered Sep 24 '22 05:09

Karl Anderson