Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Javascript a proper platform for cryptography? Or, can it be? [closed]

I noticed a good while back that Wikipedia links to a Javascript implementation of different hash functions. Also found Clipperz Crypto. Even Mozilla implements a crypto object in Firefox.

So, Is Javascript a proper platform for cryptography? Or, can it be?
Or, I suppose.. Are there any purposes or benefits for hashing data before POST?

like image 920
Jonathan Lonowski Avatar asked Oct 12 '08 13:10

Jonathan Lonowski


2 Answers

There are uses for hashing functions in Javascript, for example validating captchas client side (by comparing hash in session to computed hash from input). Obviously, the uses are limited since it runs almost exclusively client side (and you can't trust client input), but the potential is there.

like image 95
Eran Galperin Avatar answered Sep 20 '22 03:09

Eran Galperin


You can encrypt data using JavaScript; however I'm not sure about the benefits. Because if you are using, let's say bas64, you need to send the encryption key to the client, and if someone can intercept the encrypted information he/ she would probably be able to intercept the encryption key too.

You should never use this for replacing SSL certificates.

like image 44
Flupkear Avatar answered Sep 19 '22 03:09

Flupkear