Skip to content
Computer Science · 12th Grade

Active learning ideas

Public Key Cryptography and RSA

Public key cryptography relies on abstract mathematical relationships that students cannot intuitively grasp without concrete, hands-on experiences. Active learning through simulations and collaborative problem-solving transforms abstract concepts like key pairs and modular arithmetic into tangible processes students can manipulate, test, and internalize.

Common Core State StandardsCSTA: 3B-NI-04CCSS.ELA-LITERACY.RST.11-12.7
30–60 minPairs → Whole Class3 activities

Activity 01

RSA Simulation: Simplified Encryption

Students work in pairs to manually encrypt and decrypt short messages using simplified RSA parameters (small prime numbers). They will practice generating public and private keys and observe the encryption/decryption process firsthand.

How can two parties share a secret without ever meeting in person using public key cryptography?

Facilitation TipDuring the Padlock and Box Key Exchange, circulate with a physical padlock and box to demonstrate the difference between locking (encrypting) with an open padlock and unlocking (decrypting) with a key.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 02

Role Play30 min · Small Groups

Key Exchange Role Play

Assign students roles as sender, receiver, and potentially an eavesdropper. The sender uses the receiver's public key to encrypt a message, which the receiver then decrypts with their private key. This highlights the secure exchange of information.

What would happen to global commerce if current encryption standards were cracked?

Facilitation TipFor Small-Prime RSA, provide calculators and prime number charts so students focus on the algorithm rather than arithmetic errors.

ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
Generate Complete Lesson

Activity 03

Collaborative Problem-Solving45 min · Small Groups

Cracking the Code: Factorization Challenge

Present students with a public key (large number) and challenge them to find its prime factors within a time limit. This activity demonstrates the computational difficulty of breaking RSA and the importance of large prime numbers.

Explain the mathematical principles underlying the RSA algorithm.

Facilitation TipIn the Think-Pair-Share activity, assign specific roles (e.g., ‘quantum skeptic’ and ‘quantum realist’) to push students beyond generic responses.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teachers often introduce RSA by starting with the mathematics of modular arithmetic and prime factorization, but students struggle to connect these steps to real-world security. Instead, begin with the padlock simulation to establish the conceptual foundation of public and private keys, then layer in the math. Avoid rushing to formal proofs; prioritize intuitive understanding through repeated, guided practice with small numbers before scaling up.

By the end of these activities, students will confidently explain why RSA works, correctly perform the steps of key generation and message exchange, and justify the necessity of asymmetric encryption in modern systems. They will also articulate the limitations of RSA and its role within hybrid encryption systems.


Watch Out for These Misconceptions

  • During the Padlock and Box Key Exchange, watch for students who assume the padlock itself is the private key and the box is the public key.

    Use the padlock to represent the public key that anyone can use to close the box, and the key inside the box to represent the private key that only the intended recipient can use to open it. Emphasize that the padlock (public key) is not a secret and can be shared openly.

  • During the Small-Prime RSA activity, watch for students who believe the public exponent (e) can be any number.

    Guide students to recall that e must be coprime with φ(n) (Euler’s totient function). Have them test values of e and eliminate those that share factors with φ(n) until they find a valid public exponent.


Methods used in this brief