Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [jwt]

JWT specifies JSON web tokens. It is defined in RFC 7519: JSON Web Token (JWT)

Filter by
Sorted by
Tagged with
0 votes
0 answers
41 views

Is integrity guaranteed by sending plain text with public key encrypted JWT and hash?

I am currently developing an RPC system that does not require message encryption, but does need client authentication and verification of message integrity. I want the RPC server to minimize its state ...
pilaoda's user avatar
0 votes
2 answers
69 views

New Service to Service Protocol Presented for Public Scrutiny (Time-based Token Signing), Is it Safe?

I came up with the following protocol to provide a life-time for JWT tokens while differentiating services to communicate securely with web services (service-to-service) using symmetric key signing ...
Adam Memisyazici's user avatar
1 vote
2 answers
452 views

sign a JWT with RS256 using a RSA-PSS SHA256 key pair?

Given a private key using algorithm RSA-PSS with SHA256 is it possible to use this key to sign a JWT using algorith RS256 (RSA with SHA256) instead of PS256 (RSA-PSS with SHA256)? The German ...
Basti's user avatar
  • 113
0 votes
0 answers
117 views

JSON Web Encryption (JWE) Key Wrapping Fundamentals - How To Encrypt Content Encryption Key?

The JSON Web Encryption RFC 7516 says: Encrypt the CEK with the recipient's public key using the RSAES-PKCS1-v1_5 [or RSAES-OAEP] algorithm to produce the JWE Encrypted Key. Assuming a client/server ...
Ronnie Royston's user avatar
0 votes
0 answers
182 views

Node.js generated JWT secret, nanoid() vs crypto.randomBytes() which is stronger

Which method will generate stronger secret? 64 character secret generated by nanoid (https://www.npmjs.com/package/nanoid) with characters: ...
wefad12292's user avatar
2 votes
0 answers
437 views

How to hash a JWT signature using Public & private key (Have both key in JSON format & X.509 PEM Format), using ES256 algo for JWT

I want to hash my signature of JWT using public & private key, since we are using ES-256 algorithm in JWT. But the problem is that I have both the keys in JSON & .PEM format, so how can I do ...
Amit Mishra's user avatar
0 votes
1 answer
163 views

How to verify that a JWT was in fact generated by the claimed issuer (iss)?

JSON Web Tokens (JWTs) (RFC, introduction) are digitally signed using a secret key (which can be symmetric, but for distributed use cases will typically be asymmetric). The signature forms the third ...
Anders Rabo Thorbeck's user avatar
1 vote
1 answer
1k views

best HMACSHA signed JWT secret length

I would like to use JWT but one thing I'm still thinking is ¿what is the best length for the secret? If I'm using HS512 as a signing method the secret should have a length of 512 bits as far as I ...
Clara Raquel's user avatar
2 votes
1 answer
2k views

is this how RS256 works in JWT?

I'm a newbie that is studying about JWT using RS256 algorithm for signing and verification. I have drawn a diagram that represents my understanding of how RS256 works. Basically, below is what I ...
William Le's user avatar
2 votes
0 answers
41 views

Fusion auth versus jose4j library for jwt using secp256k [closed]

I am a beginner in-terms of JWT libraries in programming. How the keypair used (secp256k1) is related with the algorithmic header used for creation of JWT? And why authfusion doesn't need an ...
Benjamin's user avatar
0 votes
1 answer
932 views

How to exchange keys in JWT between server and client and between shared servers?

I'm not sure I have a full understanding of JWT when it comes to the signature. The signature, as I get it, validates to the server that the header/payload that was transfer from the client is legit. ...
ProcolHarum's user avatar
0 votes
1 answer
140 views

What is the proper format/ notation for JSON Web Tokens?

A JSON Web Token is supposed to have the following format: token = encodeBase64(header) + '.' + encodeBase64(payload) + '.' + encodeBase64(signature) When I use ...
Tom's user avatar
  • 5
0 votes
0 answers
344 views

Is it secure to sign a JWT using RS256?

I have implemented an authentication scheme using JWT with assymetric keys (RS256). The idea is that (assuming some microservice-based acrhitecture) the authentication service will sign all JWTs with ...
LlewellynS96's user avatar
3 votes
1 answer
2k views

A way to get the public key of a RS256 JWT from its headers and payload?

I have a RS256 JWT, I'd like to find out its public key. Because I know the header, payload and I have the encrypted signature, is there a way to obtain the public key that made the signature from ...
hmngwn's user avatar
  • 33
2 votes
1 answer
7k views

Does the signature length of RS256 depend on the size of the RSA key used for signing?

The following NodeJS code, when run (v16.8.0), logs 512 to stdout. ...
Otto's user avatar
  • 125
0 votes
0 answers
29 views

Match any string from list to a single hash

This might be a noob question, I've searched the web but couldn't find anything remotely close to what I would like to achieve. Maybe I don't have the correct jargon, so please bear with me. Basically,...
Papooch's user avatar
  • 101
0 votes
0 answers
68 views

Securely transmit signed token (e.g., JWT) over insecure channel

Apologies if this is already answered somewhere, but I could not find it. I have a setup where a client has a JWT (RSA- or ECDSA-signed), and needs to prove that fact to the peer which issued the ...
mni's user avatar
  • 1
1 vote
1 answer
215 views

How can JWE support an integrity check given that it uses a public key to encrypt the message?

As far as I know JWE (JSON Web Encryption) supports both integrity and confidentiality. I agree about the confedintiality because only the recepient with a private key can decrypt a message. What ...
Abzal Serekov's user avatar
1 vote
1 answer
168 views

Which Cryptographic Standard ensures cryptographic agility and good adapotion

Which cryptographic message standards are recommended to ensure cryptographic agility in the future and have good adoption trough different programming languages such as .NET and Go? The standard ...
hdev's user avatar
  • 151
1 vote
0 answers
148 views

How many JWT tokens may be securely generated with one secret?

I can remember from my crypto classes, that there is a limit on how many blocks can be securely encrypted with the same key. Before we reach the limit, we should rotate the key. Does it also hold true ...
Marek Puchalski's user avatar
3 votes
1 answer
226 views

What is a "set synchronized CSPRNG"?

I'm looking to implement a performant revocation method for JWTs. I'm reading a paper, in which the following section's second paragraph states: If we use the client hashing approach described ...
Nick Bull's user avatar
  • 131
1 vote
1 answer
421 views

How RSA is implemented by authentication protocols?

I am a beginner in cryptography, i recently learned about RSA algorithm : In short, my understanding for this is : Sender needs receiver's public key to encrypt the message to a cipher so that only ...
Prabin Upreti's user avatar
0 votes
1 answer
305 views

Validating JWT works with small changes to public key, why?

I was trying to verify the following JWT on JWT.io with the following public key: ...
Krijn's user avatar
  • 115
0 votes
1 answer
165 views

JWTs vs Capability Tokens

One of the primary advantages of JWTs is that they serve as capability tokens, allowing for a portable verification of capabilities/ privileges. However, JWTs are often criticized for a number of ...
Prime's user avatar
  • 117
2 votes
1 answer
695 views

Are there any security drawbacks for simply encrypting and MACing my JWS token (JWT)?

This question, while related, doesn't answer the security aspect I have in mind. I understand that signatures make it impossible for the tokens to be modified. But if I want the JWS token content to ...
The Quantum Physicist's user avatar
4 votes
4 answers
1k views

JWT Login Security

I am new to security and I am wondering if JWT is secure enough. From what I have read online the flow goes like this: Clients log in by sending their credentials to the identity provider. The ...
user62735's user avatar
1 vote
3 answers
2k views

Base64 encoding of strings

I have read everywhere that base64 encoding of unique binary/hex values results in unique output. The following two string encode to virtually the same output. ...
Ollie's user avatar
  • 21
23 votes
1 answer
14k views

How can one validate with a public key a JWT signature generated with a private key?

As I understand it, a JSON Web Token (JWT) consists of 3 parts: the header, specifying the hashing algorithm to use for the signature; the payload itself; and the signature, which is a hash of the ...
Anders Rabo Thorbeck's user avatar
3 votes
1 answer
6k views

AES-CBC then SHA vs AES-GCM for encrypting and authenticating a web token

I am trying to have something like JWT but kinda ad hoc and encrypted. The token itself is simply a stringified JSON that contains the user ID and Unix timestamp. Now, I tried to use AES-128-GCM, ...
pls no's user avatar
  • 919
1 vote
1 answer
231 views

Is symmetric encryption with a key containing the userId passes as authentication?

The scenario: There is a web application where ownership check is time expensive so during the development all users were able to access all other user's objects (let's say apples) by changing the ...
vinczemarton's user avatar
10 votes
1 answer
13k views

HMAC-SHA256 vs HMAC-SHA512 for JWT API authentication

Which algorithm is recommended to use when encoding / decoding JWT web application tokens? Is using HMAC-SHA256 enough or would using ...
W.M.'s user avatar
  • 203
1 vote
1 answer
505 views

sign data and append certificate VS sign data and certificate

I am currently writing my masters thesis in which I need to develop a licensing module for an application. The license itself is a JSON Web Token which is signed using a RSA private key. Since we ...
MischCon's user avatar
2 votes
1 answer
458 views

JWT Common Practices

I had a few questions in regards to certain practices used by JWT developers. I'm relatively new to both encryption and JWTs and the context given is for developing a system on nodejs. How should ...
Scetra's user avatar
  • 23
3 votes
1 answer
932 views

Compromise between HMAC and Digital Signature, by encrypting and sending secret key?

For achieving stateless authentication tokens (like JWT), is there a compromise between the performance of HMAC, and public key distribution of Digital Signature? Scenario: Sender is a centralized ...
user29944's user avatar
36 votes
2 answers
17k views

HMAC vs ECDSA for JWT

I will be implementing JSON web tokens into my website and have a question about implementing them. I have a choice of using two algorithms, HMAC-SHA256 and ECDSA-SHA256. I have used HMAC-SHA256 in ...
user2924127's user avatar
9 votes
1 answer
4k views

what are the advatanges and disavantages of the digital signature algorithms for JWT?

I am using a Java JWT library jose4j. There is a list of digital signatures algorithms which can be used. HMAC using SHA-2 RSASSA-PKCS1-V1_5 Digital Signatures with with SHA-2 Elliptic Curve Digital ...
David Michael Gang's user avatar
1 vote
2 answers
706 views

Padding to increase entropy and size of (otherwise) small JSON objects

Maybe this better fits, the security stackexchange... I'm building a web API. We want to enable some relatively simple encryption, instead of going full-blown OAuth2 (which frankly, IMO, sucks). So I ...
aross's user avatar
  • 121