News for hackers. Stuff that matters.
Re:Hell Is Overconfident Developers Writing Encryption Code by pclmulqdq on Saturday February 01, 2025 @02:41AM (#42896625)
Yeah, coming up with your own signature scheme to verify authenticity with certain properties is very difficult but also very different in kind from running a pre-designed scheme using a library baked by someone else.

I think you have a pre-defined notion when I say the word "signature" about what I meant (perhaps something about software signing or SSL certificates). I literally meant "checking that HMAC-SHA-2 of some bytes is what you expect" (using a library for the hash). Incidentally, that's how you authenticate a JWT.

Re:Hell Is Overconfident Developers Writing Encryption Code by g_p on Saturday February 01, 2025 @04:54AM (#42897253)
I recently came across a signature check that was (correctly) checking the signature against a public key... The issue was the public key itself was unauthenticated, and provided by the (signed) ciphertext itself... Meaning the crypto was fine, but it wasn't checking anything meaningful, as any rogue message would just include its own public key in the message!

It's not only about the raw operation of checking bytes are equal (hopefully in a constant time manner, if applicable), but also about ensuring the desired security properties are actually present in the application!

Re:Hell Is Overconfident Developers Writing Encryption Code by quadhome on Saturday February 01, 2025 @01:45PM (#42900938)
A JWT? Me me! I've seen this done wrong!

  - memcmp(actual_sig, expected_sig) == 0
  - strcmp(actual_sig_base64, expected_sig_base64) == 0
  - strcasecmp(actual_sig_base64, expected_sig_base64) == 0