## ← Key Exchange - Applied Cryptography

• 2 Followers
• 33 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=ADcsTgwVTAc" data-team="udacity"></div> ``` 1 Language

• English [en] original

Showing Revision 2 created 05/24/2016 by Udacity Robot.

1. Here's the idea of the protocol.
2. First they agree on 2 shared values.
3. The first is q, some large prime number,
4. and the second is g, and g is a primitive root of q.
5. What it means to be a primitive root is that for all numbers
6. in the group Zq, that is the numbers 1, 2, through q-1,
7. we can generate all those numbers by raising g to some integer power.
8. If q is prime, it must have a primitive root,
9. and there are ways to find these primitive roots.
10. We could think of a brute force way of trying numbers until we find one.
11. That would be very expensive for a large prime number,
12. but there are more efficient ways to find them, which we won't talk about.
14. And then here's how the protocol works.
15. Alice will select a large random number, and Bob will also select
16. his own large random number.
17. This is like selecting the secret paint colors.
18. Then Alice will compute a value we'll call yA,
19. and she'll compute that by raising g to the xA power
20. and doing this modulo q.
21. Bob will do the same thing but with his secret power xB.
22. He'll raise g to the xB power modulo q.
23. They'll exchange these values.
24. Alice sends yA to Bob.
25. Bob sends yB to Alice.
26. And then Alice will compute a key that will be shared between Alice and Bob,
27. and she'll compute that by raising the yB value that she received from Bob
28. to the xA power and do that all modulo q.
29. If this is a good key distribution protocol,
30. then there should be a way for Bob to compute the same key.
31. I'll see if you can figure that out yourself by making that a quiz.
32. These are the possible choices.
33. Which one of these should Bob compute to obtain the same key as Alice did here?