Doing Crypto In A Browser

--

Well, the world has fallen for JavaScript. It’s a horrible language and many designers struggle with it. It has been shown recently that many hackers target it as the checking of the scripts is often weak. But it works and allows us to interact with Web pages in a way that we have on our desktops. With the advent of JQuery and Node.js, it has risen to the top of the hill in software development, and few can beat it for speed and interaction.

So surely you can’t to something as complex as cryptography on within your browser? Well you can… and here’s a few examples:

  • Random number generator. Rand. Random number generator
  • AES. AES. AES encryption
  • Hash. Hash. Hashing using JavaScript
  • RSA. RSA. RSA using JavaScript
  • Password generation/hashing. Hashing. Password generation/hashing using JavaScript
  • CMS. CMS. Encapsulating with CMS.
  • Paillier crypto system (JavaScript). Paillier. Outlines Paillier crypto system using JavaScript.

For this we are running the code not on a server, but in the browser. The optimisation for each device and browser is difference, so you see a great deal of variation. If you want to benchmark, here’s a quick test:

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.