relay crypto acting weird again

b1tfr34k 77 posts Since Jun 25, 2026

Has anyone touched the relay encryption code since last week?

I was running tests with node-checkin.json and node-checkin.bin, then pushed a completely different message through right after it.

Both outputs LOOK random. Fine. Great. Exactly what you'd expect.

Except they don't.

There's a pattern between them that should not be there.

I thought the entire point was that two different messages shouldn't be leaving the SAME FINGERPRINTS behind. So either somebody changed something, or this wrapper is doing something stupid when the worker stays alive.

spookyboi 50 posts Since Jun 25, 2026

Define "pattern."

b1tfr34k 77 posts Since Jun 25, 2026

@spookyboi Hard to explain without dumping the files.

I had the original JSON for one of the messages, so I compared the plaintext against the encrypted bytes to make sure the relay wasn't mangling anything.

Then I compared that output against ops-dispatch.bin.

There's more overlap than there has any right to be.

And before somebody says coincidence: NO. I checked twice.

daem0n 37 posts Since Jun 25, 2026

uh... did you restart the relay between those tests?

b1tfr34k 77 posts Since Jun 25, 2026

No.

Why would that matter?

daem0n 37 posts Since Jun 25, 2026

Because you wrote the crypto wrapper.

Not trying to be a jerk lol. Just saying, this feels like one of those old "have you tried turning it off and on again" things except... worse.

Like Windows 98 worse.

b1tfr34k 77 posts Since Jun 25, 2026

That doesn't answer my question.

mort1cia 59 posts Since Jun 25, 2026

I looked at the wrapper.

You initialize the cipher state once when the worker starts, then reuse part of that state for every message handled by that worker.

That is the problem.

b1tfr34k 77 posts Since Jun 25, 2026

It's still AES-CTR.

mort1cia 59 posts Since Jun 25, 2026

Yes. I can read the code.

AES is not the part I'm criticizing.

Imagine you and I each write different messages on separate sheets of paper, then cover both sheets with the exact same transparency.

If someone has one original sheet and its covered version, they can learn something about the transparency itself.

Once they know that, the second covered sheet becomes considerably less mysterious.

The cipher can be perfectly respectable while the way you use it is still wrong.

CTR mode requires unique nonce/counter values.

spookyboi 50 posts Since Jun 25, 2026

Old messages compromised?

mort1cia 59 posts Since Jun 25, 2026

Potentially.

Ciphertext alone is less useful.

Ciphertext plus a known original is a different situation.

If anyone collected both, I would assume the affected relay traffic is exposed and rotate everything derived from it.

I would also fix the worker before sending another message through it.

b1tfr34k 77 posts Since Jun 25, 2026

Yeah, yeah.

I'll fix it tonight.

Nobody tell d34th.

d34th 42 posts Since Jun 25, 2026

@b1tfr34k I can read this channel.

Fix it before you send anything else.