
What it’s about
Encryption is the process of encoding information into an alternate form that is unintelligible. Decryption is the process of decoding that alternate form to get the original information.
Encryption is used to protect private information as it is transmitted through channels that can be monitored, like radio communication and the Internet. Most web sites, apps, and servers communicate over secure channels, meaning that they encrypt the data before sending and decrypt after receiving.
In this tutorial, you will start with some basic encryption concepts using one of the oldest and most simple forms of encryption, the Caesar cipher. Above is a picture of the Caesar cipher with a key of 5 applied to the first two characters in “HELLO”. The encrypted version of the H E in HELLO is M J. Can you complete the last three characters in the ciphertext?
This tutorial will guide you through writing Python scripts that can encrypt and decrypt with the Caesar cipher and some other simple ciphers.
Before you start
You will need:
- A micro:bit module (on or off a cyber:bot)
- A USB A to MicroB cable
- A computer with access to the python.microbit.org editor.
Complete these tutorials first:
- Get Started with micro:bit and Python
- Writing micro:bit programs
- Computer – micro:bit Talk
- Strings & Characters Primer
After you finish
You will be able to write scripts that use simple ciphers to encrypt and decrypt characters, words, and even complete messages. You will also have gained familiarity with keys, ciphers, and other basic cryptography terms. Along the way, you will apply some of the string manipulation skills introduced in the Strings Primer.
After this, you will also be ready to move on to the next tutorials:
Curriculum
- 1 Section
- 9 Lessons
- Lifetime
- Cybersecurity: Encryption Intro9
- 1.0Encrypt Letters by Hand
- 1.1Encrypt Letters with a Caesar Cipher Script
- 1.2Encrypt a Single Letter
- 1.3How Caesar Letter Encryption Works
- 1.4Encrypt and Decrypt with Serial Monitor
- 1.5Apply Caesar Cipher to Words from Serial Monitor
- 1.6Caesar Cipher in a Function
- 1.7ASCII and Other Simple Ciphers
- 1.8Substitution Ciphers