‘16-‘17 General Discussion for Lesson 4.7


Use this thread to discuss your questions and comments about how to run the lesson.


The links for all the files for this lesson are broken and I am not able to download the files.


Hmmm. Can you share the a link to a page with broken links? I clicked through and didn’t find anything. I wonder if we’re looking in the same places.

CSP Team.


Ah…I see. The links for PDF and Docx. Yes I see. I’ll look into that. Not sure what the issue is.

But you can open the google doc versions, by just clicking on the links, and print or save as PDF from there.

Sorry for the trouble.



I was having trouble explaining how the crypto widget calculates Alice’s public key. I reviewed the teacher notes and the document about how the widget works. Did I miss the explanation somewhere? Thanks.


Hi @jmclean

Have you checked out How and Why Does the Public Key Crypto Really Work?

-Dani McAvoy


Thanks for this answer @dani . I was wondering the same thing!


After teaching this lesson the second time around… here was how it went:

  • Some students were a little confused when using the widget as to where the calculated “public keys” came from. When you hit “Go”, it is hard to know if math is actually happening or not. I specifically mentioned that in the wrap up (that math was happening - I even showed the hand-out for the math during that part, some students were really interested in that - others didn’t care).

  • When students got in their groups of three, they were confused as to if it “worked” or not. I made it clear that if Bob is able to communicate a number to Alice and Eve has no idea what happened, then it worked. Students who played Eve weren’t really sure what they were supposed to do. Once I told them that the Eves SHOULD be confused, that helped.

  • I would read the recap and “what do you actually need to know?” portion out loud as a class. That is really important information that I think got glossed over when I taught it.


To me what’s the most confusing is I didn’t even know where to start trying to understand what this widget is doing. I’m not talking about the mechanics, like the math (although that part is more advanced for sure)… but taking bits of info from the lesson and the task, I figured out some basic stuff. I’m not sure if this stuff was just assumed that the user would know and was not communicated well, or that I just had a really hard time figuring out what other people had already inferred from the get-go.

Here’s (obvious?) stuff that helped me:

  • Bob is trying to send a message to Alice. Not the other way around
  • The message Bob is trying to send is the “secret number”. The “secret number” IS the message that (we want to keep secret from Eve)
  • Alice is waiting for Bob’s message to return, but it will return as a public message. As a general rule, replace the word “number” in the widget with the word “message”. The public number/message is like when Bob in the cup/bean demo passes back the cup with his secret beans. It’s “public” but conceals his secret message.
  • When Alice receives the public message, she must “unlock” it using her private key. Her private key is analogous to the private mailbox key in the video. It is needed to “access/unlock” messages from the public.
  • In terms of math, forget the actual operations for now, but it starts to make sense what terms are even in the equations, given what info is needed. Thus the following…
  • For Bob to calculate his public number (public message), he needs Alice’s public key to access her mailbox and also needs to include his secret message (secret number). And the public mod? uhhh… that’s um… Alice’s public mailbox number… her address. yeah. That’ll work. Thus, his equation must include Alice’s public key, his own secret number, and Alice’s public mod.
  • Then for Alice to calculate Bob’s secret message, she needs his secret number (secret message), plus her own private key to unlock her mailbox, plus her public mailbox number (mod).

Before figuring this stuff out, I had absolutely NO context of what was happening in that widget. I was just selecting random numbers, not knowing what the goal was or what any of those numbers meant or who was trying to communicate what to whom.

Once I spend half an hour working out all that stuff above in my head, then maybe, maybe I can start thinking about the math…


Hi frank,

Thanks for bringing this to our attention. This widget was (finally) updated this week and I think that put the lesson and resources in a state of limbo.

From your message here I’m suspicious that resources are just missing from the lesson that should be there. I’m going to go investigate and update the lesson accordingly.

But first of all, you basically got it right! Stay tuned.



I used water bottles and small marbles for the Bean and Cup lesson.


I just did this lesson and the most powerful learning for me and the class was how simple it is to calculate the public key and how it is impossible to backwards engineer the one-way function. It feels like you should be able to set the variable equal to x and do some math to figure it out, but nope.


Blast! I just made a giant update to this lesson. Because I lot of people had trouble with it. Mostly just making all of the steps a little more clear. The bones are the same.

But I did a section that explains this multiplication+modulo business. I added an activity guide that also explains why you can’t solve the equation like you typically do in math class. https://docs.google.com/document/d/1JRWUKPl_3Pd6UUDub6aQ3hhUbb5HPioqJl2K4ipbRe0

If you want to review with your students you could use it. Sorry the update wasn’t there sooner.



Baker I just completed your new modulo and multiplication activity guide. A couple of questions I have which I just can’t seem to reason through

1)On the first page with a clock size of 13 and using powers of 10 … I get the answers to be 1,10,9,12,3,4 but i don’t understand the significance of those results and since you asked the question if the results surprise me, I’m guessing i should be taking something anyway from those values

  1. what is this trying to show me in regards to the increment? I see when i increment A the result increases by 13 and then wraps around. I don’t understand the relevance of 13 but i know it’s important. When i increment B my results increases by the multiplier of B i.e. 20. Once again what should i take from this and explain to my students that will help them as we moved to the crypto widget

omg i may have just had a stroke of inspiration or perhaps simply a stroke. Do the 13 and 20 represent the public and private keys? and if so which is which

I’m pretty sure once you explain it to me i’m going to feel rather dumb but for the life of me I can’t get it on my own

Would you put this activity right before the crypto widget activity?

In the crypto widget activity are we supposed to be able to figure out how the public key is computed


So, your answers might be in the…wait for it…answer key. Which, of course, you might not have known about because I realized about 20 seconds ago we didn’t reference it in the lesson plan. You can get to it from the teacher only area here: https://studio.code.org/s/csp4/stage/7/puzzle/1

Go check that out first and ask followup questions.

And yes, this goes right before the public key crypto widget because it shows the basic math the widget is doing - or at least explains why it’s hard to crack.


Perfect. exactly what i was looking for
Thanks so much!!!


Am I missing an answer key for the “Activity Guide - Multiplication + Modulo?” I thought I clicked through all of the resources, but I can’t seem to find it! Thanks!


The answer key is in the teacher only area: https://studio.code.org/s/csp4/stage/7/puzzle/1


Thank you, @karenma! No clue how I missed it!