Daily Mail PH

Friday, September 20, 2024

Cryptographic Innuendos

Neil Madden recently wrote a blog post titled, Digital Signatures and How to Avoid Them. One of the major points he raised is: Another way that signatures cause issues is that they are too powerful for the job they are used for. You just wanted to…
Read on blog or Reader
Site logo image Dhole Moments Read on blog or Reader

Cryptographic Innuendos

By Soatok on September 20, 2024

Neil Madden recently wrote a blog post titled, Digital Signatures and How to Avoid Them. One of the major points he raised is:

Another way that signatures cause issues is that they are too powerful for the job they are used for. You just wanted to authenticate that an email came from a legitimate server, but now you are providing irrefutable proof of the provenance of leaked private communications. Oops!

Signatures are very much the hammer of cryptographic primitives. As well as authenticating a message, they also provide third-party verifiability and (part of) non-repudiation.

Neil Madden

Later, he goes on to make recommendations for alternatives. Namely HMAC, possibly with a KEM. His recommendations are sensible and straightforward.

Where's the fun in that, though?

Fingerguns Sticker
CMYKat

Let's design a type of digital signature algorithm that can only be verified by the intended recipients.

Standard Crypto Disclaimer

Don't use any of this.

I'm rolling my own crypto, which is almost always a bad idea, for my own amusement.

Absolutely none of this has been peer-reviewed or audited.

Even if there's no immediately obvious fatal flaw in this design, it's always possible that I screwed something up.

If anything of value ever comes of this post, it will be serious cryptographers writing their own protocol that accomplishes the goals set out in this furry blog post, but with a machine verifiable security proof.

X3MAC

Let's start with a somewhat simple building block (using libsodium), which I call X3MAC.

Why? Because it's partly inspired by X3DH.

The idea is pretty straightforward, and basically in line with what Neil recommended:

  1. Generate an ephemeral keypair.
  2. Do two ECDHs. One between the sender and the recipient, the other between the ephemeral keypair and the recipient.
  3. Use a domain-separated hash with both ECDH outputs and all three public keys to obtain a symmetric key.
  4. Calculate a MAC over the message, using the symmetric key.
  5. Return the ephemeral public key and MAC.

Verification is basically deriving the same symmetric key from the recipient's perspective, recalculating the MAC, and comparing the two in constant-time.

This should be pretty easy to understand.

Why bother with ephemeral keypairs?

It doesn't buy us much for the MAC use-case (since we aren't encrypting so forward secrecy isn't a consideration), but we will use it when we turn the X3MAC into X3SIG.

What are people saying about X3MAC?

When I showed X3MAC to some friends, some recoiled in horror and others said, "Oh, I think I have a use case!"

Sarah Jamie Lewis said, "thank you i hate this."

I really hope they're joking. But out of caution, this is where I will cease to provide sample code.

Turning X3MAC into a Signature

X3MAC isn't actually very useful.

If Alice and Bob use X3MAC, it's true that only the two of them can verify the authentication tag for a message... but both parties can also create authentication tags.

To turn this into a signature algorithm, we need to work with the Ristretto group and build a non-interactive variant of Schnorr's identification protocol.

My modified protocol, X3SIG, uses Ristretto scalars and points instead of X25519 keypairs.

The protocol begins the same way as X3MAC: Generate a random scalar, multiply it by the base point to get a point. Do some point-scalar multiplications and a domain-separated hash to derive a symmetric key. Hash the message with the symmetric key.

But this time, we don't stop there. We use the X3MAC-alike hash in place of the Hash() step in non-interactive Schnorr.

Important: We can eschew some data from the hashing step because certain parameters are fixed by virtue of using Ristretto255.

If anyone ever builds something on another group, especially one where these parameters can change, you MUST also include all of them in the hash.

If you fail to do this, you will find yourself vulnerable to weak Fiat-Shamir attacks (e.g., Frozen Heart). If you're writing Rust, check out Decree for transcript hashing.

(As stated before: No sample code will be provided, due to not wanting people to ship it to production.)

What does this give us?

Alice can sign a message that only she and Bob can verify. Bob cannot generate a new signature. Third parties cannot perform either action.

Thus, we still have a digital signature, but not one that provides third-party verifiability.

X3INU - Cryptographic Innuendos

If we had stopped the train at X3SIG, that'd be pretty neat.

However, X3SIG is limited to one sender and one recipient. This is kind of a bummer that doesn't scale very well.

Fortunately, this is a solvable problem.

If you recall from my idea for multicast support in Noise-based protocols, I'm no stranger to reusing the TreeKEM abstraction from the MLS RFC to nerd-snipe my friends in the cryptography community.

So let's do that here.

X3INU.Pack

Inputs:

  1. 1 keypair (sk, pk)
  2. A finite number of other public keys (pk_i for many values of i)

Output:

  • Group public key gpk

Here, we use a Ratchet Tree (per RFC 9420) where each step is a scalar multiplication over the Ristretto group (since that's what everyone's public key is) and a Key Derivation Function.

The important property is that each participant in the Pack can asynchronously derive the group secret key, and it's computationally infeasible to do so without one of the pack members' secret keys.

This step must be performed ahead of time to establish the Pack (quorum of recipients that can verify a signature).

X3INU.Howl

Inputs:

  1. The message being signed.
  2. The secret key for the entity sending the message.
  3. The pack public key for all of the recipients.

Outputs:

  1. A signature that only pack members can validate.

Here, we just perform an X3SIG signature with the pack public key.

X3INU.Hear

Inputs:

  1. The message being signed.
  2. The signature.
  3. The public key for the entity sending the message.
  4. The secret key for a pack member.
  5. The pack public key for all other recipients.

Outputs:

  1. Boolean (is the signature valid?)

Here, we just perform an X3SIG validation.

If you're a member of the pack that can validate the signature, you can derive the group secret key and perform X3SIG as usual.

If you're not, you can't tell if the signature is valid or not. To you, it should be indistinguishable from random.

Evil Laugh
CMYKat

X3INU Questions and Answers

Why "X3INU"?

It's short for "innuendo", but also "inu" is the Japanese word for "dog", and I like to make furry puns.

Why "Pack", "Howl", and "Hear"?

See above! Furry puns!

Why are you like this?

Blep Tongue Sticker
CMYKat

I dunno.

You fool, this already exists in the cryptographic literature under a different name! What do you have to say for yourself?

Okay, yeah, probably.

I'm not an academic, so if I reinvented something that someone else made (except worse, because this is being published on a furry blog for fun), that's kind of cool but not surprising.

It also shouldn't be surprising that I haven't heard of it before, due to me not being an academic.

What if I think this might actually be useful?

Normally, I would say, "Talk to a cryptographer before writing any code," especially if you're writing your own protocol that uses a Fiat-Shamir transform like I did here.

However, if it turns out that X3INU is in any way novel or valuable, you should instead consult the entire cryptographic community and wait for their verdict on whether this idea is totally bonkers or not.


Header art by Harubaki and CMYKat.

Dhole Moments © 2024.
Manage your email settings or unsubscribe.

WordPress.com and Jetpack Logos

Get the Jetpack app

Subscribe, bookmark, and get real‑time notifications - all from one app!

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com Logo and Wordmark title=

Automattic, Inc.
60 29th St. #343, San Francisco, CA 94110

at September 20, 2024
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Capping off 2025 with new Gen Z report, big team announcement – The Nerve

We have a couple of big announcements to cap the year   17 December 2025 View in Browser     Dear reader,    We have a couple of big ann...

  • [New post] Tuesday’s politics thread is trying to stay positive.
    SheleetaHam posted: " Even though I just finished the latest Opening Arguments podcast about how Roe v. Wade is toast, and ...
  • [New post] Achieve Data Sovereignty through Omnisphere
    Crypto Breaking News posted: "Web 3.0 is one of the biggest buzzwords flying around the world of social media this year. An...
  • [New post] Is XRP going to take the Crypto market by storm
    admin posted: "Is XRP going to take the Crypto market by storm While the SEC has been going after Ripple in court the XRP b...

Search This Blog

  • Home

About Me

Daily Newsletters PH
View my complete profile

Report Abuse

Labels

  • Last Minute Online News

Blog Archive

  • December 2025 (7)
  • November 2025 (4)
  • October 2025 (2)
  • September 2025 (1)
  • August 2025 (2)
  • July 2025 (5)
  • June 2025 (3)
  • May 2025 (2)
  • April 2025 (2)
  • February 2025 (2)
  • December 2024 (1)
  • October 2024 (2)
  • September 2024 (1459)
  • August 2024 (1360)
  • July 2024 (1614)
  • June 2024 (1394)
  • May 2024 (1376)
  • April 2024 (1440)
  • March 2024 (1688)
  • February 2024 (2833)
  • January 2024 (3130)
  • December 2023 (3057)
  • November 2023 (2826)
  • October 2023 (2228)
  • September 2023 (2118)
  • August 2023 (2611)
  • July 2023 (2736)
  • June 2023 (2844)
  • May 2023 (2749)
  • April 2023 (2407)
  • March 2023 (2810)
  • February 2023 (2508)
  • January 2023 (3052)
  • December 2022 (2844)
  • November 2022 (2673)
  • October 2022 (2196)
  • September 2022 (1973)
  • August 2022 (2306)
  • July 2022 (2294)
  • June 2022 (2363)
  • May 2022 (2299)
  • April 2022 (2233)
  • March 2022 (1993)
  • February 2022 (1358)
  • January 2022 (1323)
  • December 2021 (2064)
  • November 2021 (3141)
  • October 2021 (3240)
  • September 2021 (3135)
  • August 2021 (1782)
  • May 2021 (136)
  • April 2021 (294)
Simple theme. Powered by Blogger.