DEV Community

Discussion on: End-to-End Encrypted Chat with the Web Crypto API

Collapse
 
cardoso profile image
Matheus Cardoso

Thanks for your comment! I didn't want to touch on private key persistence methods in this tutorial. If I got into that, I'd also need to tell how to recover or rotate the key pair in case the persistent storage is lost. So it was better just to leave it like this and tell that the private key is sensitive.

Collapse
 
yoursunny profile image
Junxiao Shi

Then you should use non-exportable key and pass it around as a variable.

Thread Thread
 
cardoso profile image
Matheus Cardoso

I left it like that to allow more than one session per user, mostly for not making the test app annoying to use. But I'll add further notes to emphasize that it's not great practice. Thanks :)