3 ms·
Just plain-old username and password. Before launch I'll experiment with running everything over SSL, but it might turn out to be too much overhead for a bunch
by dfranke 19y ago
Just plain-old username and password. Before launch I'll experiment with running everything over SSL, but it might turn out to be too much overhead for a bunch of tiny AJAX requests. If so, then I'll keep the session in cleartext but do secure login by implementing DH key exchange in JS.
- buss 19y agoShock! Horror! Diffie-hellman in javascript is a really bad idea. Javascript would be unbearably slow for the size numbers you'd have to work with for a good implementation of DH, if it could even represent numbers that large. From http://www.howtocreate.co.uk/tutorials/javascript/security: http://www.howtocreate.co.uk/tutorials/javascript/security: "The problem is that in order to prevent brute force cracking techniques, these require the browser to handle numbers as high as 2x10^600 or higher. JavaScript is just not natively capable of working with numbers as high as this." Why reinvent a great and secure technology like SSL? The overhead of SSL would pale in comparison to rolling your own DH in JS.
- brl 19y agoNot only that, but to implement diffie-hellman key agreement correctly you have to authenticate the exchange in some way. This is usually done with cryptographic signatures and that means implementing at least one other number theory algorithm with even more slow big integer exponentiation.
- dfranke 19y agoDH without authentication still fends off a large class of attackers. Spoofing IPs is hard. Typing 'tcpdump' is easy.
- dfranke 19y ago> JavaScript is just not natively capable of working with numbers as high as this. Implementing multiple-precision multiplication is hardly rocket science. > Why reinvent a great and secure technology like SSL? The overhead of SSL would pale in comparison to rolling your own DH in JS. I'm not trying to reinvent it. I'm just trying to make a very lightweight alternative for protecting your password and nothing else. The DH in JS would just be just be run once when you logged in, not for the entire session like I'd like to do with SSL. Obviously SSL is preferable if it works.