JWE verification is valid after providing secret key as Buffer with an invalid string | Node.js #452
-
Hello Dear Community! To create a JWE I need a secret key in KeyObject or Uint8Array format.
Works fine, we created a JWE. Then I want to provide an invalid secret, changing my .env key for testing that JWE will be invalid if the secret key is not correct.
My JWE is still VALID but it shouldn't be as I changed a secret string in .env file. After comparing two buffers with different strings I can see that they are equal, but why?
P.S. I haven't worked with Buffers too much before :| THANKS! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Notice the same buffer comes out. What you want to do is e.g. Buffer.from('059bde05519b5a8098f1007fc8dd28ad223378a997ed3750edfb0895859ee18d', 'hex') |
Beta Was this translation helpful? Give feedback.
Notice the same buffer comes out.
What you want to do is e.g.