Run, data, run

Hi again. You may consider this a follow-up to my most recent post about great low-budget while functional wristwatches, but this is going to be a bit shorter and more general thought stream about a topic that is somewhat tangent to what I had overviewed. Sometimes i just google (or rather whoogle) strange (or not so strange) things for no apparent reason. And guess what do you get when you search for “hacker’s watch”?

Let me tell you one thing: just like with anything else hacker-related, you get a set of results full of stereotypes. At best, you get the reference to Casio ATC-1100, the first ProTrek ever released (in 1994, although this series got the ProTrek name only in 1995 with the DPX-500 release), the one worn by the “Hackers” (1995) movie protagonist, Dade Murphy. Sometimes, you’ll find the mentions of Timex Datalink series or Casio DBA series (yes, the ones with Telememo and built-in DTMF dialers with a tiny speaker). Most of the time, however, you’ll get links to some DIY projects where people create programmable replacement boards (or even entire modules) for F-91W or CA-53 watches, extending their capabilities with Bluetooth, infrared, NFC, Wi-Fi or even UHF connectivity, data storage, making fully customizable LCD watch faces and so on, or even creating fully custom watch designs, from the PCB to casing.

What do all these examples have in common? That they, while all being fascinating on their own (that is, if no one calls them “hacker’s watches”), have nothing in common with reality, as they are fully based upon the mainstream societies’ perception of hackers and their culture. People often view hackers purely as tech geeks who only praise functionality and always get something as recent and cutting-edge as they can, with as many gizmos, bells and whistles as possible. They didn’t picture Dade Murphy wearing an ATC-1100 because he actually used all the functions it had, as it never happened. Besides the usual timekeeping, I remember him only using an alarm in the movie; by the way, why would a megapolis dweller like himself ever need to use a thermometer that he needs to take off his wrist in order to display the correct temperature, an altimeter or a digital compass? Oh no, they pictured him wearing an ATC-1100 (that just came out last year) because wearing a much less bulky and more practical DW-5600E wouldn’t be as z3r0 c00l for him. I don’t even mention F-91W or anything from the DBA series (as any watch rated under WR50 might not survive the final scene in the pool) but come on, how much lamer can you get with this product placement? Anyway, the entire movie was overflown by stereotypes but we still love it for other things regardless.

This movie, however, was probably the first mass culture event that spawned a completely wrong perception of what a hacker’s watch should look like. Yes, all those F-91W upgrade boards and other DIY wearable gadgets are inseparable from the hacker culture, all those vintage Datalinks are really zero cool given what they can do. But I just can’t imagine any of it to be that popular to make any kind of impact. Most public, even the tech-savvy one, just won’t notice these inventions, there are too few of them compared to how much of this public really is out there. And absolutely not everyone who even knows about their existence can afford to purchase them or make something like that by themselves. This is also why the real world is much more prosaic than they usually portray in the films and other mainstream media.

So, what kind of watches do hackers of today actually wear? I don’t have a widely representative selection in front of me, but I think it would be safe enough to say that most of them wear… nothing. They just blend in with the rest of society and get used to seeing the time on their phones, not even thinking about the level of convenience of doing so or the side-effects of carrying a device that allows to track you all the time. Another part uses a fitness band or a smartwatch which might be even worse. Heck, some of the people I had regarded as very smart and security-aware now even think it is totally normal to use an iPhone + Apple Watch pair, quoting, “because I know Apple treats my data in a secure way, and you’re just overly paranoid about everything, don’t forget your tinfoil hat”. Well, we’ll see about that, but the entire hacking scene seems to revolve around completely different values nowadays. Who has time to reflect on these values and their own lifestyle when it comes to money one way or another?

Now, let me share my own vision on the “hacker’s watch” question. If you buy a programmable replacement board for your F-91W, wait for up to a month or so for its delivery and proudly install it yourself into your watch casing, you don’t even become a hacker, you still are a consumer, just the product you consume is much more niche now. Moreover, unless you order a dozen of such boards at once (and I don’t even know the real volumes they’re currently being produced in), you’re going to treat yours as delicately as possible, knowing all the troubles and time consumed just to get it into your hands once again. Well, this is not the hacker’s way, not even remotely. A real hacker always uses the most ubiquitous tools that can be found and easily obtained anywhere in the immediate vicinity (so that it is affordable to lose them if anything), and does wonders with these tools by exploring, discovering and implementing new ways to use them.

Since we are talking about wristwatches, here’s a relevant example I’m going to explore here: using a simple watch to store arbitrary binary data. The Data Runner concept, while incredibly cool, is not a hacker’s way. On the other hand, the Telememer library from my previous post is. Because it doesn’t require you to buy anything additional to make use of it. And it is suitable for a large amount of Casio models (up to 20) “as is”, and for even larger amount with minor modifications to the algorithm parameters. By the way, did you know that module 2515 (Casio DB-36/360) only allows to store up to 98 bits per record (leading to 367-byte storage capacity) using the same algorithm even if we turn on French language that allows us to enter the biggest variety of characters in the contact name? And even if we switch the language every time, it would only increase the capacity to 105 bits per record and 393 bytes in total, but would require much more button presses to implement every single data entry. And the “e-data memory” in G-2900F (module 2548) only allows to store up to 251 bytes even though it doesn’t have the autosorting nonsense. This is why I consider the standard Telememo 30 format (as found in the modules 2747, 3793, 5479, 5565, 5574, 5679 and 5699) a perfect way to implement this feature even though it is not so obvious and easy as transferring the data using an NFC chip. Well, as I already said, easy ways are for consumers, hackers are doing what they can (and even more) with what they’ve got. I wish Casio still manufactured their DTMF-enabled models though, but that’s another story.

But what if I told you that in some cases we don’t even need the Telememo/databank facilities to store critical bits of information in a digital, ana-digi or even purely analog watch? No magic involved, just plain good old information theory. Yes, I’m talking bits here, as we’re entering the area where every single bit matters. But still, how big of a piece of information could we possibly hide? Well, even if it is just 14 bits, it can hold any 4-digit PIN, and 20 bits can hold a 6-digit PIN. If it’s 32 bits, this means any IPv4 address. If it’s 40 bits, it can already be used as a key for some crypto algorithms like CAST-128. If it’s 48 bits, one can fit in an OLC-encoded geoposition with up to 3.5 m accuracy, or it can already hold most international phone numbers. So, while the amount of information we could possibly store inside the watch in a very tricky way might not seem a lot even when compared to the Telememo’s 3030-bit behemoth, it surely can be important.

Let’s start with the simplest case - a dateless analog watch, like my favorite Miyota 2035 based Casio MQ-24 and MQ-71. It allows us to stop the second hand in any position and set the minute and hour hands anywhere on the 12-hour dial. So, we can choose from any of the 12 hours, 60 minutes and 60 seconds, that’s giving us the possibility to encode any number from 0 to 12 * 60 * 60 = 43200. If we round the log2 of this value down to how many bits it is, we’ll get 15 bits. Not bad, 3-digit CVC/CVV numbers and 4-digit PINs are already covered. Now, let’s add the date window (like in MW-59) and the amount of combinations is 31 times bigger now. This allows us to multiply 43200 by 31 and get 1339200 as the maximum encoded number, which gives us 20 bits to store 6-digit PINs. And if we also add the day of the week, the maximum number ramps up to 1339200 * 7 = 9374400, or 23 bits of pure data. Not to mention that the weekdays in some models are bilingual, which would allow us to double the number and add one more bit. But this is a rarer situation, so let’s settle on the conclusion that a typical analog quartz watch with three hands and a day+date complication allows us to store up to 23 bits of information.

Note that in the first case, we can make the watch stop, rendering it useless as a watch but useful for data storage. For the ana-digi and purely digital watches, I’ll be providing my calculations under the assumption that we cannot. And for the ana-digi example, I obviously won’t be using AW-80 or something equally advanced with the world time and so on. I’ll be using my AW-49H or any equivalent on the module 5154/5156/5696. While being quite old, this ana-digi concept is still popular in lots of Casio models that are even more budget than AW-80 and dressier than AW-49 or AW-90, so it’s worth mentioning here.

First, let’s notice the following aspects: the dual time here is set completely independently (down to the minutes), the analog time is also set completely independently, and there is 20-second resolution of the minute hand when it comes to setting the analog time. These aspects alone allow us to encode the difference between the main digital and dual time up to the full 23 hours 59 minutes (24 * 60 = 1440) and the difference between the main digital time (in 12-hour format, of course) and analog time with 20-second resolution (12 * 60 * 3 = 2160), so just the combination of these two differences allows us to encode a number up to 1440 * 2160 = 3110400, which corresponds to 21 bits. And we’re just getting started. Because there also are a single alarm (×1440), an alarm on/off switch (×2), an hourly chime switch (×2), 12/24h main time switch (×2), an independent 12/24h dual time switch (×2) and independently set day of the week (×7, obviously we’re encoding the difference here). This alone gives us the maximum encoded number of 3110400 * 1440 * 2 * 2 * 2 * 2 * 7 = 501645312000, or 38 bits of info. Which is, honestly, already better than I hoped for. But then, we didn’t utilize the date difference as of now. This watch doesn’t know about the leap years so we assume 365 days difference at most. This is what we multiply our value by, and settle on the number 183100538880000 that gives us… 47 bits. Very impressive, considering we haven’t even touched the stopwatch yet. But let’s save it for later.

Now, let’s explore how big of a number we can store using different components of a standard module 593 Casio watch like F-91W (after all, it is the watch subject to all that modding I was talking about), and do the bit conversion in the very end.

  1. Alarm. The most obvious place to store a number up to 24 * 60 = 1440.
  2. 12/24 hour switch, hourly chime switch and alarm on/off switch. Each of these flags doubles the amount of options, so in total we can already store a number up to 1440 * 8 = 11520. Again, already enough to store 4-digit PINs.
  3. Stopwatch. Now, that’s a delicate one and depends on whether or not we can stop it at the precise 1/100s moment or wait for up to an hour for the desired value to appear. For now, let’s assume we can’t fix the 1/100s values and cannot wait for more than a minute, which multiplies our options by 60, giving 11520 * 60 = 691200 as the max number.
  4. Day of the week. Now, we’re starting to get into a more obtrusive realm and changing what we can actually see in the timekeeping mode. Yet, if we only care about displaying the correct time, we can further fiddle with date and day, and take the full advantage of the fact the day in module 593 is also set manually and independently, multiplying our number by 7 and getting 4838400 as the new record. Obviously, we encode this as an offset from the real day. By the way, at this point, 6-digit PINs are already covered.
  5. Month and date. Again, this is the offset that requires some manual calculations, but this allows our number to be multiplied by 365, and the new maximum is a whopping 1766016000.

So, we can encode a number from 0 to 1766016000 to be stored in an F-91W-like watch without affecting the currently displayed time. Good! But how many bits is that? Well… Not even 32. Just 30. How can we improve on that? By waiting for more time by the stopwatch, of course! So, let’s allow to wait up to 3 minutes instead of one. This alone will increase the amount of information we could store to our minimum viable requirement, 32 bits. Note that further waiting time increments are not as efficient in terms of added bits and quite literally not worth your time. Even if we could wait for up to an hour, this would just increase the maximum size to 36 bits. Nowhere near the 48 bits we’re looking for. Note that the 593’s stopwatch also has a split function but, unfortunately, the second value and the split indicator don’t get saved when switching to another mode, so they can’t be used for our purposes.

Now, let’s assume we don’t care about the currently displayed time and treat our watch as a data storage facility only, encoding the remaining bits of information as an offset from the real time in minutes. This would mean we’re ready to multiply our max number by 1440 once more, yielding 41 bits in our original scenario, 42 bits with 3-minute-waiting scenario and… 47 bits with full stopwatch utilization. Damn, so close! Where to get another bit? Guess what: we encode the difference in 30-second intervals instead of minutes. After all, this is Casio we’re talking about, they rarely deviate even 10 seconds a month, let alone their reference 15- or 30-second deviation. This gives us our 48 bits but really feels like a Pyrrhic victory, almost like having to switch the language in the settings after every single Telememo letter entered in DB-36 to increase the 367-byte storage to 393. So, for the module 593 with any encoding that’s non-destructive for the current time indication, I’d settle on the humble 32 bits as the practical storage limit anyway.

For 5154/5156/5696 though… Let’s return to our stopwatch. The mere fact of its usage or non-usage already gives us these 48 bits. A minute of waiting gives us 53 bits, and 3 minutes give us 54 bits. This is my non-destructive encoding practical limit for AW-49H and similar watches. Out of interest, let’s see what it would look like if we also touched the main digital time (without any perversions with 30-second intervals). Turns out that even 70-second stopwatch wait would be sufficient in this case because it already would give us 64 bits of information to encode.

So, here is your basic “poor man’s datarunner”: 15 bits for a pure three-hander, 20 bits for a three-hander with date, 23 bits for a three-hander with date and day, 32 bits for F-91W and company, 54 bits for AW-49H and company. Not sure if I ever create a library to encode/decode all the settings for all these kinds of watches (most probably, if I do, it will look like a framework that you could use to construct your own library according to your particular watch features) but that’s definitely an interesting case showing that virtually any watch you like can be made into a hacker’s watch if you know your stuff and have a real hacker mindset. And if you don’t, no custom PCBs will help you.

watches of the Trainman

P.S. Here’s the homework for the most interested folks: how much data is stored on the Trainman’s hand?