Problem
You’re helping to run an EVE Online alliance, and you’re running IT infrastructure.
You’re currently having a fight against another alliance, and their leader is smugly posting screenshots of your fleet announcements saying he knows your every move.
The alliance leadership has said you need to help them find the spy using IT.
Domain
You’ve got a chat bot that sends out the fleet alerts, and your users look like this:
case class User(
username: String,
isAdmin: Boolean,
isFleetCommander: Boolean
)We need to hide information in a fleet announcement that looks like this:
TALWAR FLEET UP UNDER CAPQU, LEAVING FROM UW9B, GET HYPED
== broadcast at 21:35 UTC from lucia_denniard to alliance ==
Easiest Solution
So, what’s the easiest thing we can do?
TALWAR FLEET UP UNDER CAPQU, LEAVING FROM UW9B, GET HYPED
== broadcast at 21:35 UTC from lucia_denniard to evil_spy ==
Well we can embed the username of the user we’re sending this message to, but that’s so obvious they’ll crop it out unless they’re extremely lazy.
Hashing?
Well, let’s get a bit fancier, what about if we hash their user ID…
import scala.util.hashing.MurmurHash3
MurmurHash3.stringHash("evil_spy")
// res0: Int = -818893062Okay that’s kind of long but maybe we could pretend it’s a second and microsecond timestamp?
TALWAR FLEET UP UNDER CAPQU, LEAVING FROM UW9B, GET HYPED
== broadcast at 21:35:81.8893062 UTC from lucia_denniard to evil_spy ==
This looks pretty suspicious, and users would probably notice if the microsecond was always the same, so…
Multiple hashes?
We’re sending this message at 21:35 so maybe if we hash that too it’ll get a bit less suspicious…
import scala.util.hashing.MurmurHash3
MurmurHash3.stringHash("21:35" + "evil_spy")
// res1: Int = -1615894254TALWAR FLEET UP UNDER CAPQU, LEAVING FROM UW9B, GET HYPED
== broadcast at 21:35:16.15894254 UTC from lucia_denniard to evil_spy ==
Okay that’s a bit better, we can add more hashes in if we need to, but this will let us calculate who got a given message.