Chapter 3: Year 1995 ->

Securing the Cabins: Hack-Proofing the VHS Vendetta

Listen to the Chapter and Follow Along with the Transcript


Not long after launching my stock management software, a friend referred me to a “sole trader.” Let’s call him Sole Trader. In those days, video libraries were all the rage, but this one wasn’t your typical rental place. Nope, this guy ran an adult video library—VHS tapes, of course. But here’s the kicker: it wasn’t just about renting tapes. Customers could watch them in private cabins, and the rental was charged by the minute. Talk about a niche market!

Sole Trader turned out to be a real character, always cracking jokes and keeping the mood light. But behind all the laughs, he had a serious problem. The software he was using to run his business was anything but secure. His employees, armed with a little database knowledge, were manipulating the system with a FoxBase client—pretty much open season on his profits. It didn’t take long before he noticed the issue, hired new people, but the same thing happened again.

So, he came to me with a challenge: rewrite his DOS-based software to make it impossible for anyone to hack the database or manipulate the system. Hmm, let me think… At the time, we didn’t have many options for database engines, and the machines could be easily booted with a different DOS operating system. It wasn’t like there was some magic “secure database” button to press. But hey, I had done assembly for the ZX Spectrum, so how hard could it be to create something unique? Well, challenging, but doable.

I decided to go all in and use Assembly for x86 to build everything from the ground up. I wanted a database that would encrypt data in a way that wasn’t easy to reverse-engineer. The goal? Fast enough performance to not slow things down, while keeping the encryption rock solid. I was using XOR encryption with a hash, reordering bytes in a specific order, and sprinkling in some salt values for good measure. But it wasn’t just about encrypting data. I needed to get creative with indexes, hashed indexes, and even a balanced BTree—one that could be rebalanced as records were inserted, updated, or deleted.

It took way longer than I had anticipated, but I didn’t give up. I had a mission, and I was determined to finish it.

There was one more thing, though: the system needed to control the VHS video players remotely. The customers were paying for X minutes of “joy,” and the video players needed to turn off automatically when their time was up. Enter my father, the electrical engineer. I had learned a thing or two from him over the years, and now was the time to put that knowledge to the test. I designed a small electronic circuit that connected to the computer’s LPT (printer) port and sent impulses to the stop button of the video players.

It was one of the toughest challenges I had faced, but also one of the most rewarding. The money I earned was symbolic at best, but the experience and knowledge I gained? Priceless.

Next Chapter
VHS Video Library