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
1
vote
0 answers

JWE Encryption / Decryption using EC (ECDH_ES_A256KW, A256GCM) in .NET Core 3.1

I'm using the "jose-jwt" library in C#. I'm able to get JWE encryption / decryption working for both RSA (RSA_OAEP_256, A256GCM) and EC (ECDH_ES_A256KW, A256GCM) in .NET 4.8. See sample code below. However for .NET Core 3.1, only the RSA…
Carl Prothman
  • 1,461
  • 13
  • 23
1
vote
0 answers

IdentityServer4 client application: ArgumentNullException: IDX10000: The parameter 'hashAlgorithm' cannot be a 'null' or an empty object

Implementing IdToken token response type flow for MVC 5 client, getting an error saying ArgumentNullException: IDX10000: The parameter 'hashAlgorithm' cannot be a 'null' or an empty object. it seems to be failing for, Alg received as hmac and…
Cod29
  • 265
  • 4
  • 14
1
vote
1 answer

iOS swift : SecKeyCreateWithData returns nil

Trying to generate a SecKey from SecKeyCreateWithData function of swift as below. The SecKeyCreateWithData is always returning nil with below error log. Can anyone please help. Note : Both cekKeyData as CFData and attributes as CFDictionary are not…
Max
  • 5,380
  • 6
  • 42
  • 66
1
vote
1 answer

How to add expiry to JWE?

I am trying to add expiry time to JWE which I am generating using jwcrypto library in the following way from jwcrypto import jwe, jwk, jwt from datetime import datetime, timedelta import time # create JWK from existing key jwk_str =…
nishith
  • 1,223
  • 1
  • 12
  • 21
1
vote
1 answer

Unable to decrypt JWE token using github.com/web-token/jwt-framework

Followed the guide on https://github.com/ndi-trusted-data/myinfo-demo-app/blob/master/lib/security/security.js I managed to decrypt the JWE token in node js environment but not php. However with the same implementation in PHP, I am not able to…
1
vote
1 answer

How to add OAEPParameterSpec to a JWE object?

I need to add an OAEPParameterSpec as a AlgorithmParameterSpec to a JWE (Json Web Encryption) object. How can I do that? I'm using a client - server application. server is encrypting in RSA-OAEP-256 encryption algorithm, client is failing at…
RBis
  • 33
  • 5
1
vote
0 answers

Decrypting a JWE token using JOSE with A256GCM

I'm curious about this and wanted to see if anyone understands it. I am encoding a payload using the jose-jwt nuget in .NET: Jose.JWT.Encode( payload, keyBytes, JweAlgorithm.A256GCMKW, JweEncryption.A256GCM, extraHeaders:…
Nick
  • 2,877
  • 2
  • 33
  • 62
1
vote
1 answer

how to make public key from string on android for JWE?

I have a public key (RSA) as a string. I want to use this key to create a secret code, lets say the unencrypted secret code is "TEST TEST" without qoutes. How can this be achieved? I mean I tried the following but stuck on creating the Key object…
msamhoury
  • 333
  • 3
  • 12
1
vote
1 answer

ECDH + JWE encryption/decryption using jose4j

I am trying to implement ECDH encryption/decryption along with JWE in Android (Java). I have found the jose4j and Nimbus JOSE libraries that aim to do everything I need but appears that it's more challenging than I thought. If anybody is familiar…
Michael Kessler
  • 14,245
  • 13
  • 50
  • 64
1
vote
0 answers

Why do I get an error decrypting JWE between Java and Go

I am not able to encrypt/decrypt within Java and Go using Curve P521, ECDH-ES, and A256GCM using the same values for curve X, Y, and D. When I try to take the encrypted value from Go and Decrypt in Java it fails or vice versa it fails with: Go:…
user1701907
  • 98
  • 11
1
vote
0 answers

Decrypt the Content Encryption Key of a JWE with Openssl

I have a JWE and I want to decrypt the Content Encryption Key (cek) with openssl (and other command line) here my…
lecogiteur
  • 307
  • 1
  • 7
  • 16
1
vote
2 answers

'node-jose' library is using 'zlib' library as a dependency which throws an error. How do I fix it and have you encountered the same problem?

I'm trying to use the node-jose library with angular7 for the use with JWEs. The library uses zlib as a dependency and it throws an error when compiling: ERROR in ./node_modules/zlib/lib/zlib.js Module not found: Error: Can't resolve…
1
vote
1 answer

Is there any standard order for nesting JWS and JWE tokens?

I need to pass JSON-encoded signed (and sometimes additionally encrypted) objects between multiple instances of my software. The obvious choice here is JWT. Yet, JWT allows apparently to both sign and encrypt a token (JWS and JWE) or nest JWS into a…
Xenonite
  • 1,823
  • 4
  • 26
  • 39
1
vote
1 answer

JOSESwift jwe encryption failed to decode in the nimbus server

Had anybody used JOSESwift successfully? In my case, decryption in the server failing, probably cannot find the matching private key or wrong with encryption. Getting error 500. My code is, getting the public keys from a server.…
karim
  • 15,408
  • 7
  • 58
  • 96
1
vote
0 answers

Spomkylabs Jose PHP

I need to decrypt my cipherText using the content encryption key + IV and validate it against the AAD and tag using A128CBC-HS256. I have found this library doing this. But, I do i use it? I have searched for other jwe libraries, but they only…
Spiral1ng
  • 313
  • 1
  • 7
  • 16