Меню ▼

Design ⚡️ Life

Alex Buznik Logbook

The Caesar Cipher: A 2,000-Year-Old Lesson in Secret Writing

A little history

The Caesar cipher is one of the oldest and simplest encryption techniques we know of, and it comes with a famous namesake. According to the Roman historian Suetonius, Julius Caesar used it to protect his private and military correspondence, shifting each letter of the alphabet a fixed number of places. Caesar reportedly favored a shift of three: A becomes D, B becomes E, C becomes F, and so on, wrapping around at the end of the alphabet so that X, Y, and Z loop back to A, B, and C.

His nephew Augustus is said to have used a similar trick with a shift of one. Because so few of Rome’s enemies could read Latin at all — let alone recognize a scrambled version of it — even this modest scheme was enough to keep messages private on the battlefield.

The cipher belongs to a family called substitution ciphers, and the “shift” version specifically is sometimes called a shift cipher or, in its most general rotational form, ROT-N. You may already have met its most famous descendant: ROT13, a shift of 13 once used all over early internet forums to hide spoilers and punchlines.

Why it stopped being secure

By modern standards, the Caesar cipher offers essentially no protection. There are only 25 possible shifts, so an attacker can simply try all of them — a technique called brute force — and read whichever result makes sense. Even without brute force, frequency analysis cracks it easily: in English, E is the most common letter, so the most common letter in the ciphertext usually reveals the shift. Arab scholars such as al-Kindi described exactly this attack over a thousand years ago, and it’s what makes the cipher a poor choice for real secrets today.

Why it’s perfect for the classroom

That very weakness is what makes the Caesar cipher such a wonderful teaching tool. It’s the ideal on-ramp to cryptography and computational thinking:

– It’s tangible. Anyone can encrypt a word by hand in seconds, which makes the abstract idea of “encryption” concrete for a first-time learner.
– It teaches core CS concepts. Shifting letters is a natural introduction to modular arithmetic (the “wrap-around” at Z), character encoding, and simple loops — great for beginner programming exercises.
– It introduces the mindset of a codebreaker. Because it’s breakable, students get to be the attacker too. Trying all 25 shifts or counting letter frequencies teaches that security isn’t about cleverness alone — it’s about how hard something is to break.
– It sets up the “why” of modern crypto. Once students see how quickly a 25-key cipher falls, they understand why today’s algorithms rely on astronomically large key spaces. The Caesar cipher is the “before” picture in the story of modern encryption.

Try it yourself

The best way to understand a cipher is to play with one. I’ve put together a small, interactive Caesar cipher tool you can use right in your browser — type a message, spin the shift, and watch it scramble and unscramble in real time:

👉 Try the Caesar Cipher tool here

Encode a note to a friend, then challenge them to crack it without knowing the shift. Two thousand years after Caesar, it’s still a surprisingly fun way to learn how secrets are kept — and how they’re broken.

Some projects from the past months

In this time weeks feel like months in terms of tech-related news and the new technologies.

I have been fiddling a lot with AI-driven development at work, namely using Cursor and claude all the time. Instead I started code-reviewing even more than ever – not only the code of my human teammates, but not also the code produced by AI.

Everything moves so fast that I just wanted to note a few thing. I’m pretty sure even few months from now it would feel “ugh, so much May 2026”, but still it’s important for me.

In no particular order:

Sourdough IoT sensor

I managed to build and run a sourdough IoT sensor. Okay, this have been in the works for quite a long time (at least since last summer), but I’ve got to admit using LLM sped up iterations unbelievably. Troubleshooting unknown issues now takes minutes – instead of going a long cycle the forum and waiting for a person respond. Bad news for forums, for sure, on the other hand there should be some real communication and sharing happening now instead of newbies asking the same questions over and over again. Was especially surprising and valuable to find it out in the Arduino context. 

So what I built? A system is of 4 main components – IoT sensor, IoT message broker, the web-server storing the reading into a database and a mobile application sending push-notifications on important events (like sourdough starting to fall down).

I’m pretty happy with the sensor – based on ESP8266 (Wemos D1 mini) it fulfils the requirements of being ultra-low power (by going into deep sleep between transmissions, which are done using ESP-NOW), uses time-of-light for the measurements, rechargeable, transmits data through the fridge door and can sit on a battery for weeks (estimated).

(more…)

AI game experiment (init)

Inspired by some things that my direct manager is doing with ChatGPT I tried to do another experiment.

This time I asked it to develop a sea ships game, with a network connection where multiple players can take turns.

Overall for this version I spent about two hours and several iterations to create front-end and backend.

Obviously, this is just a prototype, but overall it’s a start!

Smoke and Temperature Sensor for my 3D-printer

Sometime ago I bought an IKEA smoke sensor. It lived some time in the kitchen as expected, but then I put next to my 3D-printer that was located in the garage.

But then, it doesn’t make a lot of sense if it only fires an alarm in case of smoke, since I maybe away, so I decided to hack it into something IoT.

There are a couple of useful blog (this and that) posts that I started from.

It took quite a while to just follow the advice given there and to solder properly ground connection to the CS2105G0-S12 chip (that people suggest is actually MC145012). Anyway my project is a bit simpler in a way – the wi-fi module (Wemos D1 mini) is constantly powered with USB and feeds data every second to Blynk.

One other issue I had was that smoke sensor IC is using 9V for power and signals, so it had to be stepped down. With invaluable help from my former colleague Mich, I did it using an NPN transistor and it works pretty smoothly.

Printed a special case for it to fit all the components.

In case of smoke the Blynk app will send me a notification. Later on, it will also turn off the smart socket that the printer is powered with.

Arduino source is on Github. I will try to put some more details and the scheme later.

I have no illusions that this thingy is pretty weak in terms of safety and reliability – there are too many things to break in case of a real fire – but it was an important learning project for me.

Bought a 3D printer!

Finally I bought a 3D printer – an almost complete kit for popular Creality Ender 3.

It happened to be a decent printer that produces fairly quality prints.

Some test prints:

Some things I tried to model:

Created a new instagram account and post stuff related to 3d-printing and general DIY: @shu.makes

The journey continues!

Repurposed an old iPad as a home status screen

Here is my new small project – TableStatus/StenGazeta (Daybook.buznik.family as of November 2020).

I have been thinking about creating some kind of a status screen for my home and family for a long time.

Our friends have recently donated an old iPad 2 to us. It runs iOS 9.3.5, so I can barely install a handful of apps from Appstore. That’s where this idea started.

I could never gather all the details until this Christmas, when I got some time and slapped together a preact web app.

Demo

Features

It’s a web page that displays widgets:

  • daily weather – temperature, conditions and humidity, and lunar phase
  • agenda – events from our shared calendar for the day (events are also togglable, so you can use it as wishlist)
  • photoslider with pictures from selected google photos albums
  • simple notes

Nothing particularly interesting about those – mostly leveraging a couple of APIs.
I used openweathermap.org for weather, and Google APIs to retrieve the calendar and photos.

The notes are just a text area that stores value in localStorage, not synced across sessions.

Usage

You can just visit Daybook page on your iPad and it will work.

In order for Calendars and Photos to work, you need to login with your Google account.

Source and Setting Up

Right now, I’m happy with the result, though I’m adding some ideas as enchancements on Github.

Source code on Github

It has a readme which has some notes on the API keys that you need to get and some other vars to set up.

The project is build with webpack and can be hosted on any kind of hosting. I use Netlify for it.

You can set up one for youself, too.

Anyway, let me know if you’d like to use it, but it lacks something via this form.

A note to React gurus and beginners

The project is definitely not to show off my React skills, rather the opposite – I wanted to slap some stuff together in a very limited timeframe and also to try preact.

Also if you are a beginner and want to learn by its code – it’s not the best specimen.

preact

I wanted to go really minimal and was lured by preact’s promise of 3kb gzipped size.

However I ended using the preact CLI to create the project boilerplate together will the webpack and compilers and other stuff, and 260Mb node_modules.

Also tried to start with React Native, but its toolchain is still not clear to me. Ran into a couple of issues with the suggested solutions as “reinstall all your node_modules and cocoa pods”, not cool.

diPlayer – Raspberry Pi-based player for DI.FM

This is a desktop player for DI.FM that I made for the 20-year anniversary.

I gathered a lof of experience during this proejct:

  • learned how to solder (again)
  • familliarised myself with Python
  • wrote and debugged firmware for an Arduino Nano
  • learned to model in Fusion 360
  • found out that 3-d printing don’t happen right on the first time

Details

Desktop player based on Raspberry Pi, that can play DI.FM channels (IceCast streams to be exact).

It is controlled with photoslides frames that have NFC-stickers on them, the stickers point to certain channels.

The player can also play other sources like Spotify, Google Play Music, Soma.fm thanks to MusicBox software.

It has a physical Play/Pause button, volume knob and a small screen that displays current track. Sound output is through audiojack or HDMI (Raspberry Pi standard).

(more…)