Skip to content
Computer Science · 12th Grade · Data Science and Intelligent Systems · Weeks 19-27

Encryption Standards and Hashing

Students study encryption standards and hashing algorithms, understanding their role in data security and integrity.

Common Core State StandardsCSTA: 3B-NI-04CSTA: 3B-IC-28

About This Topic

Encryption and hashing are foundational tools for protecting data, but they serve different purposes and students frequently conflate them. Encryption transforms data into a form that can only be read with the correct key, making it reversible by design. Hashing produces a fixed-length fingerprint of data that cannot be reversed, making it ideal for password storage and data integrity verification. The US K-12 Computer Science Framework (aligned with CSTA 3B-NI-04) expects students to distinguish between these tools and evaluate their appropriate use cases.

Symmetric encryption uses a single shared key for both encryption and decryption, making it fast but requiring secure key exchange. Asymmetric encryption uses a public-private key pair, solving the key distribution problem at the cost of computational overhead. In practice, modern systems such as TLS combine both: asymmetric encryption to exchange a session key, then symmetric encryption for the bulk of data transfer.

Active learning is especially effective here because the concepts are abstract until students work through concrete scenarios. Role-play exercises, card-sort activities, and live demonstrations with common tools let students build mental models they can test and revise, rather than memorizing definitions they struggle to apply.

Key Questions

  1. How do encryption algorithms balance security with computational speed?
  2. Differentiate between symmetric and asymmetric encryption and their use cases.
  3. Analyze the role of hashing in ensuring data integrity and password storage.

Learning Objectives

  • Compare and contrast the security strengths and weaknesses of symmetric and asymmetric encryption algorithms.
  • Analyze the role of hashing in verifying data integrity and securing password storage in real-world applications.
  • Evaluate the trade-offs between computational speed and security level for different encryption standards.
  • Design a scenario where a combination of symmetric and asymmetric encryption is optimally used for secure communication.

Before You Start

Introduction to Cryptography

Why: Students need a basic understanding of what cryptography is and its general purpose in securing information before learning about specific standards.

Data Representation and Encoding

Why: Understanding how data is represented in binary and how it can be transformed is foundational for grasping the concepts of encryption and hashing.

Key Vocabulary

Symmetric EncryptionA type of encryption that uses a single, shared secret key for both encrypting and decrypting data. It is generally faster than asymmetric encryption.
Asymmetric EncryptionA type of encryption that uses a pair of keys: a public key for encryption and a private key for decryption. It solves key distribution problems but is computationally more intensive.
HashingA one-way process that converts an input of any size into a fixed-size string of characters, often called a hash value or digest. It is irreversible and used for integrity checks and password storage.
Data IntegrityEnsuring that data has not been altered or corrupted during transmission or storage. Hashing is a primary method for verifying data integrity.
Salt (Hashing)Random data that is added to a password before hashing. It helps prevent attackers from using precomputed rainbow tables to crack passwords.

Watch Out for These Misconceptions

Common MisconceptionHashing and encryption are the same thing -- both hide data.

What to Teach Instead

Encryption is reversible with the right key; hashing is a one-way process with no key. Pair-and-compare activities where students attempt (and fail) to reverse a SHA-256 hash make this distinction concrete and memorable.

Common MisconceptionLonger keys always mean slower performance, so there is a direct security-speed tradeoff.

What to Teach Instead

Modern algorithms like AES-256 are highly optimized and fast enough for most applications. The real tradeoff involves algorithm design, not just key length. Benchmarking exercises comparing AES and RSA at different key sizes reveal this nuance directly.

Common MisconceptionIf a password is hashed, it is impossible to recover the original password.

What to Teach Instead

Unsalted hashes are vulnerable to rainbow table attacks, where precomputed hash-to-password tables can reveal common passwords instantly. Showing students a rainbow table lookup on a weak password is a memorable demonstration that salting and strong hashing algorithms like bcrypt exist for good reason.

Active Learning Ideas

See all activities

Card Sort: Encryption vs. Hashing Use Cases

Print 20 scenario cards (e.g., 'storing a password in a database,' 'sending a credit card number online,' 'verifying a file download'). Students sort each card into Encryption, Hashing, or Both categories, then compare with another pair and resolve disagreements. Debrief as a class to address edge cases and hybrid scenarios.

25 min·Pairs

Think-Pair-Share: Choosing the Right Algorithm

Present three scenarios on the board (high-speed database encryption, secure email, password storage) and ask students to individually identify which algorithm type fits best and why. Pairs discuss their reasoning, then share with the class while building a comparison chart together on the board.

20 min·Pairs

Jigsaw: Symmetric vs. Asymmetric Encryption

Divide students into two expert groups -- one studies symmetric encryption (AES, key exchange challenges), the other studies asymmetric encryption (RSA, public-private key mechanics). Expert groups then remix so each new group has one member from each side, who teaches the other and they jointly document a comparison.

40 min·Small Groups

Gallery Walk: Hashing Algorithm Comparison

Post chart-paper stations around the room labeled with different hashing algorithms (MD5, SHA-1, SHA-256, bcrypt). Students rotate through, adding facts, use cases, and known vulnerabilities from their research notes. The class synthesizes findings into a recommendation matrix showing which algorithm fits which scenario.

35 min·Small Groups

Real-World Connections

  • Financial institutions like banks use asymmetric encryption to establish secure connections (TLS/SSL) for online banking, protecting customer data during transmission. They then often use symmetric encryption for faster processing of large transaction volumes.
  • Cloud storage providers such as Google Drive or Dropbox utilize hashing algorithms to verify that uploaded files are not corrupted and remain identical to the original. They also use hashing to efficiently detect duplicate files, saving storage space.
  • Software developers employ hashing to secure user passwords. Instead of storing passwords in plain text, they store the hash of the password along with a unique salt for each user, making it much harder for attackers to compromise accounts even if the database is breached.

Assessment Ideas

Quick Check

Present students with two scenarios: Scenario A describes a system needing to encrypt large video files for transfer, and Scenario B describes a system needing to verify that a downloaded software update has not been tampered with. Ask students to identify which primary cryptographic technique (symmetric encryption, asymmetric encryption, or hashing) is most appropriate for each scenario and briefly explain why.

Discussion Prompt

Facilitate a class discussion using the following prompt: 'Imagine you are designing a secure messaging app. What are the advantages and disadvantages of using only symmetric encryption versus only asymmetric encryption for sending messages? How might you combine both to create a robust system that balances security and performance?'

Exit Ticket

On an index card, ask students to write: 1. One key difference between encryption and hashing. 2. An example of a real-world application where hashing is crucial for security. 3. A situation where asymmetric encryption is preferred over symmetric encryption.

Frequently Asked Questions

What is the difference between encryption and hashing in computer science?
Encryption is a two-way process that transforms data using a key and can be reversed with the correct key. Hashing is a one-way function that produces a fixed-length output and cannot be reversed. Encryption protects data in transit or at rest; hashing protects passwords and verifies file integrity without ever needing to store the original value.
When should I use symmetric vs. asymmetric encryption?
Symmetric encryption (like AES) is faster and suits bulk data transfer or file encryption where both parties already share a key. Asymmetric encryption (like RSA) is slower but solves the key distribution problem, making it ideal for secure key exchange and digital signatures. Most real-world systems use both together, as HTTPS does with TLS handshakes.
Why do websites store hashed passwords instead of encrypted ones?
If a server storing encrypted passwords is compromised, an attacker who finds the decryption key can recover all passwords at once. Hashing has no decryption key, so even a stolen database of hashes gives attackers no direct path to the originals. Adding a random salt to each hash also defeats precomputed rainbow table attacks against common passwords.
How does active learning help students understand encryption and hashing?
Abstract cryptographic concepts become clearer when students physically sort use cases, trace algorithm steps on paper, or run short benchmarking scripts. Role-playing key exchange scenarios -- where one student acts as the certificate authority and another verifies the chain of trust -- builds intuition that reading a textbook description rarely achieves as efficiently.