A
A
Alexander Diunov2015-04-21 12:44:33
JavaScript
Alexander Diunov, 2015-04-21 12:44:33

What data encryption method to use on the client (javascript)?

Task:
To make on the client (javascript) encryption of the data that the user enters for their subsequent transfer to the server for storage (in encrypted form).
Accordingly, when a user logs in, the encrypted data is downloaded from the server and decrypted on the client.
Tell me, what encryption method or algorithm is better to apply to solve the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
evnuh, 2015-04-21
@evnuh

UPD: a more Orthodox way has been proposed. ATTENTION: all security principles are violated in the above example in order to simplify the scheme to the utmost.
A more Orthodox way, on the advice of Andrew :

  1. When registering a user and at each login, we generate a key pair from a password for asymmetric encryption (pub, priv), according to a given algorithm. Thus, even when changing the browser, we again get the same pub and priv from the password. At the same time, the server owner has only pub for user authentication (by simply comparing two public keys on the server and on the client) and for encryption, it is impossible to get priv from it.
  2. Further, we encrypt all the information (at least on the client, at least on the server) using pub and decrypt it on the client using priv.

S
Sergey Melnikov, 2015-04-21
@mlnkv

tutorialzine.com/2013/11/javascript-file-encrypter

V
Vladimir Martyanov, 2015-04-21
@vilgeforce

What do you want to achieve? Protecting transmitted data? Then it's better to use https.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question