An introduction to hSub

What is an hSub?

hSub is an acronym for Hashed Subject. It's function is to provide a means
for individuals to identify their own messages from within a shared mailbox
using a specially coded Subject header.

What's a shared mailbox?

As its name suggests, a shared mailbox is one used by more than one person.
All of the messages in the mailbox are encrypted and can only be decrypted
by their owner. In the context of this page, the shared mailbox in use is
the Usenet Newsgroup alt.anonymous.messages.

Using an hSub to identify the message owner

Actually it's impossible to identify a message owner using an hSub. The hSub
employs a one-way hashing cipher which, as its name suggests, can only be
encoded, not decoded. This is an important concept to grasp in understanding
an hSub. The only way to verify if a message belongs to an individual is to
encode another hSub using the same criteria as was used to generate the one
being checked. If the criteria matches, the resulting hSub will be identical.
This is known as a hash collision.

Getting technical

An hSub consists of two parts, a random number and a passphrase. The random
number is public but the passphrase is private. The random number is always
generated by the server or service and is openly included in the published
hSub. Each user of the shared mailbox then tries to generate an hSub using
that same random number. A collision informs the user that the message being
tested is for them.

The Gory Details

If you just want to use hSubs, you can ignore this section. If you want a
technical understanding, please read on.

As mentioned in the above section, an hSub is generated using a random number
and a passphrase. The actual process is:

The resulting hSub is always 80 hex digits (320bits) but is frequently
truncated, for example, 48 digits to make it indistinguishable from the older
eSub format. When validating an hSub, the length of the original should define
how many bits must collide.

Reference Implementation

The following Python code provides a reference for generating and testing
hSubs.