How can I become an algorithm ninja

Blog

Every one to two months we organize a SmartNinja Challenge, in which our students / course participants can compete to create the best software projects.

For the May / June 2020 Challenge, participants would need a desktop program or a web application to use Caesar encryption create.

Caesar encryption? What's this?

Caesar encryption is one very simple method of encrypting data. It was made by the famous Roman Emperor Julius Caesar named who used this method to prevent unwanted eyes from reading his messages.

Nowadays this method of encrypting data is outdated and insecure, but back then (when only a few people could read or even decrypt a text) it was a very effective method.

You may have used Caesar's cipher than you did in the school were and your classmates Paper notes Have written. To prevent other classmates from reading your note, you probably used Caesar's cipher - without knowing that you used a method over 2000 years old!

How does Caesar encryption work?

Suppose we want to encrypt this text: "Hello"

To encrypt the text, we will add the letters of the word to a specific number move, we say by 3 places. This means that we are rotating the entire alphabet three places.

In this case, A becomes D, B becomes E, C becomes F, and so on (at least in the english alphabet):

This is our message "Hello" to "Kdoor".

The recipient of our message needs to know the number by which we shifted the alphabet (in our case 3). However, this information must remain secret, only the sender and recipient should know it. That's why we call this information one secret key.

Of course, with an encryption algorithm as basic as Caesar's cipher, anyone could just try all possible combinations and find out what the secret message is. This type of "attack" on the cipher is called "Brute force" attack (because we try all possible combinations).

The challenge

The challenge our students had to meet was to create a program that would do the Caesar encryption for us (so that we don't have to do it manually).

The program could be either one Desktop program or one Web application be.

Additional requirements were that of the program in python had to be written (at least the part that implements the actual Caesar encryption algorithm) and the participants had to write the algorithm themselves.

No programming package (a pre-written section of code) was allowed to be used that would perform the encryption / decryption part. Furthermore, the program had to have a Graphical user interface (GUI).

Who won?

Two students got the best score and won the competition: Beno and Jaka. Congratulations!

Beno

Beno attended our course Programming for beginnerswhere he learned how to use the Python programming language and create desktop applications.

He developed a desktop program and used Tkinter for the graphical user interface.

The secret key (number) comes with a Slider selected. As you move the slider, the moves red line of letters also in real time, so that you get a nice overview of the conversion of letters.

By clicking the check box Benigma you can reset the entire process. Instead of encrypting, the program starts decrypting a message.

The code from Beno's solution is available here on GitHub.

Jaka

Jaka attended two of our courses: Web Development 1 and Web Development 2. Instead of a desktop program, it has a Web application created.

His web app uses a popular Python framework called Flask. Jaka used JavaScript.

The user interface was made with the help of HTML and CSS and the website adapts well to mobile screens (Responsive design).

Jaka's code is accessible on his GitHub account and the web app runs on Heroku web servers.

Congratulations!

We warmly congratulate both winners. You did a great job! 🎉 We are looking forward to the further SmartNinja Challenges and exciting results. Stay up to date here on our GitHub account 🤓

challenge cryptography