Skip to content

Public Key Cryptography and RSAActivities & Teaching Strategies

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.

12th GradeComputer Science3 activities30 min60 min

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.

Prepare & details

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

Facilitation Tip: During 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.

Setup: Groups at tables with problem materials

Materials: Problem packet, Role cards (facilitator, recorder, timekeeper, reporter), Problem-solving protocol sheet, Solution evaluation rubric

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
30 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.

Prepare & details

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

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

Setup: Open space or rearranged desks for scenario staging

Materials: Character cards with backstory and goals, Scenario briefing sheet

ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
45 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.

Prepare & details

Explain the mathematical principles underlying the RSA algorithm.

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

Setup: Groups at tables with problem materials

Materials: Problem packet, Role cards (facilitator, recorder, timekeeper, reporter), Problem-solving protocol sheet, Solution evaluation rubric

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management

Teaching This Topic

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.

What to Expect

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.

These activities are a starting point. A full mission is the experience.

  • Complete facilitation script with teacher dialogue
  • Printable student materials, ready for class
  • Differentiation strategies for every learner
Generate a Mission

Watch Out for These Misconceptions

Common MisconceptionDuring 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.

What to Teach Instead

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.

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

What to Teach Instead

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.

Assessment Ideas

Quick Check

After Small-Prime RSA, provide students with a small set of prime numbers (e.g., 5 and 13) and a modulus (e.g., 65). Ask them to calculate the public exponent (e) and private exponent (d), then encrypt and decrypt a simple message (e.g., the number 7) using these keys. Review calculations for accuracy.

Discussion Prompt

After the Think-Pair-Share activity on quantum computing, pose the question: ‘If a hacker could factor numbers with 2048 bits in under a second, what would be the immediate impact on global e-commerce and secure online banking?’ Facilitate a class discussion on the consequences and potential solutions.

Exit Ticket

After the Padlock and Box Key Exchange, have students write down two key differences between symmetric and asymmetric encryption on a slip of paper. Then, ask them to identify one specific scenario where asymmetric encryption, like RSA, is essential.

Extensions & Scaffolding

  • Challenge early finishers to research real-world RSA key sizes and compare the computational cost of factoring 1024-bit versus 2048-bit keys.
  • For struggling students, provide pre-generated key pairs and have them trace a message through encryption and decryption using colored highlighters to mark each step.
  • Deeper exploration: Have students research how RSA is implemented in TLS 1.3 and compare it with elliptic curve cryptography in terms of performance and security assumptions.

Ready to teach Public Key Cryptography and RSA?

Generate a full mission with everything you need

Generate a Mission