Computer Science
Grade 6
20 min
Cryptography: Encryption and Hashing
Study cryptography, including encryption (symmetric and asymmetric) and hashing, and their applications in securing data and communication.
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Define plaintext, ciphertext, encryption, and decryption.
Explain the role of a 'key' in cryptography.
Differentiate between encryption (two-way) and hashing (one-way).
Manually encrypt a short message using a simple Caesar cipher.
Manually decrypt a short message using a simple Caesar cipher and a given key.
Describe why hashing is used for storing passwords.
Identify at least two real-world examples of where encryption is used.
Have you ever sent a secret note to a friend? 🤫 How did you make sure no one else could read it?
In this lesson, we'll explore the digital version of secret codes, called cryptography. You will learn how encryption keeps your messages private and how hashing protects your passwords, which are super important sk...
2
Key Concepts & Vocabulary
TermDefinitionExample
CryptographyThe science of writing and solving secret codes to protect information.Using a secret decoder ring to send a message that only your friend with the same ring can read.
PlaintextThe original, readable message before it's been scrambled.The simple message 'hello'.
CiphertextThe scrambled, unreadable message after it has been encrypted.If you encrypt 'hello' with a simple code, it might become 'khoor'.
EncryptionThe process of turning plaintext into ciphertext using a secret code or 'key'.Using a rule like 'shift every letter forward by 3 places' to turn 'cat' into 'fdw'.
DecryptionThe process of turning ciphertext back into plaintext using the correct 'key'.Using the rule &...
3
Core Syntax & Patterns
Caesar Cipher Algorithm
Ciphertext Letter = Plaintext Letter + Key
This is a simple encryption method. To encrypt, you pick a number as your key and shift each letter of your message forward that many places in the alphabet. To decrypt, you shift the letters backward by the same key.
The One-Way Hashing Rule
hash_value = hash_function(data)
Hashing is like putting something in a blender. You can put 'apple' in and get a smoothie, but you can never turn the smoothie back into a perfect 'apple'. This is used for passwords because even if a hacker steals the hashed passwords, they can't easily figure out the original ones.
5 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
You receive the ciphertext 'GDKKN'. You know it was encrypted with a Caesar cipher and that the first letter of the original message was 'E'. What is the key?
A.Key is 2
B.Key is 3
C.Key is 1
D.Key is 4
Challenging
A new messaging app needs to store user passwords for login, and it also needs to let users send secret messages that can be read later. Which methods should it use?
A.Encryption for passwords and hashing for messages.
B.Hashing for passwords and encryption for messages.
C.Hashing for both passwords and messages.
D.Encryption for both passwords and messages.
Challenging
You are given the ciphertext 'B' which was encrypted from a single letter using a Caesar cipher with a key of 3. What was the original plaintext letter?
A.E
B.A
C.Y
D.Z
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing FreeMore from Cybersecurity: Principles, Threats, and Defense Mechanisms
Introduction to Cybersecurity: Concepts and Principles
Common Cybersecurity Threats: Malware, Phishing, and Social Engineering
Network Security: Firewalls, Intrusion Detection Systems (IDS), and VPNs
Authentication and Authorization: Access Control Mechanisms
Web Security: Cross-Site Scripting (XSS) and SQL Injection