Hashing of usernames in syslog

Forrest J. Cavalier III mibsoft at epix.net
Sun Sep 29 02:45:55 UTC 2002


> I would like to be able to hash every occurrence of usernames which
> appear in syslog entries made by nnrpd. This feature would be
> configurable in inn.conf and would require SSL. It would use the SHA-1
> cryptographic hash function. I haven't thought this through in detail,
> but here is my initial idea of an approach.

I'm not an expert in this area, but I have needed to implement
simlar systems.  From memory there are a few gotchas to
avoid.  (Others may wish to step in and correct or add to
what I wrote...)

If you are hashing usernames in order to obfuscate them, be aware
that it can be trivial to create a dictionary of user-ids and the
corresponding hashes.

One way to limit this ability is to use a fixed secret (or "salt")
which is hashed along with the username.  

But you must be sure to use a high entropy secret, and you must
keep it secret.  

How you incorporate the secret into the md5 matters also: You
should calculate md5("secret" "username" "secret"), and not
md5("username" "secret") or md5("secret" "username")  (This
is to disrupt known plaintext attempts to determine the secret.)

The "known plaintext" means that an attacker with
a valid user ID and access to the output can identify which
log entries are theirs.  This gives them the plaintext and
the hashed value.  (And makes it easier to search for the
secret.)

For cryptographic purposes, you should know that there are some
who consider md5's "reversible", and that SHS1 is better.  If true,
then recovering the secret is not impossible, although the
md5("secret" "username" "secret") form makes it much harder.

Again, don't rely on my advice.  I am not an expert and this
is all from memory.






More information about the inn-workers mailing list