Questions tagged [jwe]

JSON Web Encryption (JWE; RFC 7516) represents encrypted content using JSON-based data structures.

JSON Web Encryption (JWE) [RFC7516] represents encrypted content using JSON- based data structures [RFC7159]. The JWE cryptographic mechanisms encrypt and provide integrity protection for an arbitrary sequence of octets.

Two closely related serializations for JWEs are defined. The JWE Compact Serialization is a compact, URL-safe representation intended for space constrained environments such as HTTP Authorization headers and URI query parameters. The JWE JSON Serialization represents JWEs as JSON objects and enables the same content to be encrypted to multiple parties. Both share the same cryptographic underpinnings.

Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) [JWA] specification and IANA registries defined by that specification. Related digital signature and MAC capabilities are described in the separate JSON Web Signature (JWS) [JWS] specification.

Names defined by this specification are short because a core goal is for the resulting representations to be compact.

156 questions
17
votes
3 answers

Implement Diffie-Hellman key exchange in Java

I am trying to implement Diffie-Hellman key exchange in Java, but I'm having a hard time understanding the specification: Complete the Diffie-Hellman key exchange process as a local mechanism according to JWA (RFC 7518) in Direct Key Agreement mode…
Noureddine AMRI
  • 2,942
  • 1
  • 21
  • 28
13
votes
3 answers

JWT encrypting payload in python? (JWE)

According to RFC 7516 it should be possible to encrypt the payload/claim, called JWE. Are there any python libraries out there that support that? I've checked PyJWT, python-jose and jwcrypto but they all just have examples for signing with HS256…
Johnny
  • 133
  • 1
  • 2
  • 13
13
votes
3 answers

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…
JHH
  • 8,567
  • 8
  • 47
  • 91
12
votes
1 answer

What is the difference between JOSE, JWA, JWE, JWK, JWS and JWT?

What is the difference between JOSE, JWA, JWE, JWK, JWS and JWT and how are they related to one another?
Marco
  • 5,555
  • 2
  • 17
  • 23
8
votes
3 answers

RSA Encryption function in Swift 4 from Public Key string

My ultimate goal is to create a JWE string, given a public key for iOS. To make things easier for myself, I've broken down my steps so most pressingly, I need to create an encrypted key using RSA encryption from a secret key and public key…
clientside-gem
  • 83
  • 1
  • 1
  • 4
8
votes
2 answers

Combining JWE and JWS

Just learning about JOSE and I understand that JWE is for encryption and JWS is for signing. What I don't seem to be able to find examples of is a payload that is both encrypted and signed. Let's pretend I have a payload hello world. Is the correct…
aroooo
  • 4,726
  • 8
  • 47
  • 81
7
votes
2 answers

How to decode JWE token in Angular

I have this problem, I created a JWE in .net core using EncryptingCredentials by this way: var key = Encoding.ASCII.GetBytes(Configuration["Core:JwtSecret"]); var encryptionkey = Encoding.ASCII.GetBytes(Configuration["Core:JwtEncrype"]); var…
Mostafa Azarirad
  • 629
  • 1
  • 6
  • 27
7
votes
1 answer

how to generate encrypted JWE with node-jose

I'm using node-jose v0.11.0 (https://www.npmjs.com/package/node-jose) for JWK and JWE operations. I have an RSA key in JWK format that I can load into a JWK key store and also extract again. However, when I try to encrypt anything, I get into the…
Ollyblink
  • 123
  • 1
  • 1
  • 10
6
votes
1 answer

How to add expiry to JWE token?

I'm using Jose library to create JWE's. I have successfully managed to create and parse JWE. JWT has fields like exp, iat which help in invalidating token after a certain period of time.How can I set expiry on JWE ? Here's what I've tried, without…
Ankit Deshpande
  • 3,476
  • 1
  • 29
  • 42
6
votes
1 answer

What is the mime type to use for JSON Web Encryption

Looking at RFC 7515 and RFC 7516, I was trying to understand what the proper mime type for the JWE should be. It looks like JWE and JWS share the JOSE header information, and JWS defines its mime type as application/jose. JWE has no explicit media…
Pawel Veselov
  • 3,996
  • 7
  • 44
  • 62
6
votes
1 answer

JWE in Spring Security OAuth2 JWT

Is it possible to use JSON Web Encryption(JWE) with Spring Security OAuth2 JWT ? Right now I have a following JwtAccessTokenConverter: @Bean public JwtAccessTokenConverter accessTokenConverter() { JwtAccessTokenConverter converter = new…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
6
votes
1 answer

Validating issuer of a security token encrypted with JSON Web Encryption (JWE)?

I've been reading the JSON Web Encryption (JWE) specification, with the latest draft being 08, as we're looking at supporting JSON Web Tokens (JWT) in our authentication server. Using the asymmetric encryption method it defines, the symmetric key…
Greg Beech
  • 133,383
  • 43
  • 204
  • 250
5
votes
1 answer

.NET Core JWE: no "cty" header

I'm using the following code to issue my JWEs: var signCreds = new SigningCredentials(new SymmetricSecurityKey(Encoding.ASCII.GetBytes(Configuration["Jwt:SigningKey"])), SecurityAlgorithms.HmacSha256); var encryptionCreds = new…
Dzmitry Shauchuk
  • 336
  • 2
  • 17
4
votes
1 answer

Unable to Read RSA Key

I need to read in an RSA private key from a file to sign a JWT. I am using the openssl to generate a private key. When decrypting the private key getting length too large error openssl genrsa -des3 -out jwt-private.pem 2048 func main() { …
user1844634
  • 1,221
  • 2
  • 17
  • 35
4
votes
0 answers

When using Keycloak as an identiy broker, how can it be configured to receive encrypted identity tokens?

I am trying to configure Keycloak as an Identity Broker between an OIDC Provider and another application. I was able to achieve successful user login when the ID Tokens were not encrypted. I am trying to configure Keycloak to be able to accept…
E Loh
  • 61
  • 6
1
2 3
10 11