Whatever happened to …

… ROT13?

Thanks to Alfred Thompson for this idea.  It came through a Facebook post.

Screenshot 2018-05-11 at 11.04.01

So, I took the bait.  It had indeed been a long time since I thought about ROT13.

I do remember in elementary school going to school with a set of twins.  At times, they had their own language.  They would talk back and forth and nobody, especially the teacher, could understand what they were saying.  It infuriated her that these two were talking “in code”.

We were no better with passing notes to each other.  Of course, we didn’t want the note to be intercepted and, if it was, we had our own “code” to make sure that the message wasn’t read.  It was only the high level type of security that someone in Grade 5 could develop.  We would just shift the letter one digit to the right.  So, DOUG would become EPVH.  All the recipient would have to do is uncode it by selecting the letter to the left.  We were so clever; that dumb teacher would never figure it out.  Ah, we should have just quit while we knew everything.

It wasn’t until I studied Computer Science (and later taught it) that the beauty of encoding a message was really appreciated.

At university, we had a number of problems to code / decode strings of characters using various algorithms.  It wasn’t until I actually taught Computer Science that I realized that ROT13 was “a thing”.  And, it was a beautiful thing to have.  The concept could be used in a number of ways.

The ROT?  It is short for “rotate”.  In essence, we were doing ROT1 in Grade 5 – rotating by one letter.  ROT13 is a very special version of this.  Since there are 26 letters in the alphabet, ROT13 meant rotating half-way through the alphabet in coding and decoding.

History

One of the topics to be covered was the breaking of the code used by the Germans in World War II.  Of course, it involved an appreciation of Alan Turing but ROT became a hands on activity as we did our own messaging.  I remember one group of students creating their own cracking device with a couple of sheets of paper.

But there’s more.

Arrays

If you create an array, say LETTER, of 26 characters, then you would assign LETTER(1)=”A”, LETTER(2)=”B”, etc.  to encode / decode, it was just matter of adding or subtracting 13 from the index to make it work.  And, of course, there was the challenge of what to do when you add to the index and it goes above index 26 or or subtracting leaves it below index 1.

Characters

Every computer programmer knows that CHR(65) is the letter A.  Actually, the whole ASCII table is just one big array, but you don’t mention that until you’re done.  So, to encode the letter A with ROT13, it’s just a matter of replacing it with CHR(78).  No need to work it out – it’s the letter N.

Strings

In another variation of a theme, forget all the fanciness of using an array.  Just go with the string itself.  DOUG  The algorithm involves determining the length of the string and then going through things extracting one letter at a time, rotating it by 13, and adding the result to an output string.  When you’re done, the message is encoded.

For some reason, this really caught student interest and led to some interesting conversations.

“If people know that it’s ROT13, it’s just as easily decoded”  (Yep)

“What if we double ROT13ed it?”  (Short discussion on the inadvisability of doing that.  In retrospect, I should have let them do it as it would have led to a better discussion – how do you know if your program works when it gives unexpected answers?)

“What if we didn’t do ROT13 but something else?”  (For every problem, there’s a solution)

“What if we ROT13 the first letter, ROT14 the second, and so on”  (Liking this line of thinking)

“What if we ROTted with a random number?”  (Slick.  I knew we taught random numbers for some reason)

“What if we ROTted with a seed from the computer clock?”  (I made the mistake of showing them how to read the computer clock and using some of it as random numbers.  When the only tool you have is a hammer, everything looks like nails)

And some good problem solving.  “We’ll send the message via email and send the decryption key in another email. ”

“What if someone gets both messages?”

“We’ll ROT the key”.  (They now own a new hammer)

It led to good discussions too.  We were using QNX as an operating system then and I created a few dummy accounts and showed them that the passwords were stored in straight ASCII.  They were appalled!

It led to some enhancements too.

“Sir, we didn’t want to be limited to the letters A-Z so we modified it for lower case, numbers, special characters, …”  (Hey, this course teaches itself)

These days, encryption is such an important topic.  As Alfred notes, there was an attempt in some newsgroups to stop people from giving away spoilers by ROT13ing them.  You could easily decode them if you really wanted to know the answer or just ignore it if you didn’t.  ROTting is a relatively easy mental exercise.  But, I’ll be honest.  I can’t remember the last time I’ve seen it in use.

But the conversation about encryption continues.

With online banking and other things, secure connections are so important.  Of course, the algorithms are so more sophisticated than ROT13 but you have to start somewhere.

For a Sunday, what are your thoughts?

  • Did you ever pass notes in school?  Did you have a way to make sure that they or their message they didn’t fall into the wrong hands?
  • Do you double and triple check for a secure connection when buying things online or doing banking?  Report cards?
  • Do you use EFF’s https everywhere extension to ensure that your connections are encrypted?
  • If you’re teaching students, what steps do you talk about to teach them about privacy online?
  • Computer Science teachers – do you have any interesting lessons about ROT13 or encryption to share?

As always, I’d be most interested in your thoughts?  Please share them in the comments below.  Bonus – you don’t have to write your own ROT13 these days – check out this site – http://www.rot-n.com/

This is part of a regular Sunday series that can be accessed here.

Do you have an idea for a topic like Alfred did?  Let me know.  You can use this Padlet for the task.

Happy Mothers’ Day

 

 

Author: dougpete

The content of this blog is generated by whatever strikes my fancy at any given point. It might be computers, weather, political, or something else in nature. I experiment and comment a lot on things so don't take anything here too seriously; I might change my mind a day later but what you read is my thought and opinion at the time I wrote it! My personal website is at: http://www.dougpeterson.ca Follow me on Twitter: http://www.twitter.com/dougpete I'm bookmarking things at: http://www.diigo.com/user/dougpete

One thought on “Whatever happened to …”

  1. This form of cypher is also know as a Caesar cipher since he used it back in his day. An updated version called the Vigenère cipher uses a key string to indicate how many characters to rotate was virtually unbreakable for hundreds of years. Easily breakable with computers though. Both are exercises in Harvard’s famous CS 50 course. I’ve had students do the basic rotate cipher myself.

    The boys in my neighborhood had our own invented language. It drove people crazy which was part of the attraction. I can still speak it.

    Some of the girls in my middle school taught themselves American Sign Language so they could share messages across the library without making noise or passing notes.

    Liked by 1 person

Comments are closed.