Giter Site home page Giter Site logo

encrypting payload about node-jsonwebtoken HOT 4 CLOSED

sshbio avatar sshbio commented on August 28, 2024
encrypting payload

from node-jsonwebtoken.

Comments (4)

goozo avatar goozo commented on August 28, 2024 1

@jfromaniello what would you recommend as a node lib which would asymmetrically encrypt JWTs from node-jsonwebtoken ?

from node-jsonwebtoken.

sshbio avatar sshbio commented on August 28, 2024

Is it useful adding possibility of encrypting payload using AES to the api?
I implemented such feature for my project and I think it can be useful in cases when payload data should be kept hidden from the client side.
I don't know whether I should release it on a different module or it can be merge to this project via pull request.

from node-jsonwebtoken.

jfromaniello avatar jfromaniello commented on August 28, 2024

The standard JWT describe two things signing (JWS: JSON Web Signature) and encryption (JWE: json web encription).

With JWE you don't encrypt the payload but the signed JWT.

There are some implementations of JWE for node.js and I will definitely consider a pull request including support for JWE tokens.

from node-jsonwebtoken.

mavvverick avatar mavvverick commented on August 28, 2024

@jfromaniello Hey, I have integrated JWE encryption within node-jsonwebtoken based on works of node-webtokens.

I have implemented modifications in sign.js which takes extra options key 'encrypt' to opt JWE automatically and verify.js is [WIP].

jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RSA-OAEP', encrypt: 'A256GCM' },function (err, signedToken) { console.log(signedToken); })

JWE uses crypto.js for content and key encryption which is included in lib, please check supported key management algorithms and content encryption algorithms here.

Do let me know if it looks good and I will raise a pull request for same.

Note, Work In Progress: jwt.verify()

from node-jsonwebtoken.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.