Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing JSON Web Encryption in Node.js

I'm looking for a way to use JSON Web Encryption (JWE) in a Node.js service. I have however only managed to find implementations of the related standard JWS. There are however several libraries for other languages, such as jose4j.

Did anyone successfully implement JWE in Javascript? I'm afraid I'm gonna gave to resort to implementing the spec myself using lower level primitives. Is there a better approach?

like image 342
JHH Avatar asked Mar 25 '15 14:03

JHH


People also ask

Is JSON Web Token Secure?

Information Exchange: JWTs are a good way of securely transmitting information between parties because they can be signed, which means you can be sure that the senders are who they say they are. Additionally, the structure of a JWT allows you to verify that the content hasn't been tampered with.


2 Answers

Here is a library that can be used from Node.js also https://github.com/cisco/node-jose. They have also a very good documentation on how to use it.

like image 86
VuesomeDev Avatar answered Oct 12 '22 12:10

VuesomeDev


There is a library js-jose https://github.com/square/js-jose. But it works only for Chrome. It does not work for Internet Explorer nor for FireFox.

like image 30
Oleksandr Tsurika Avatar answered Oct 12 '22 12:10

Oleksandr Tsurika