# CS4ProgrammingWeek4

Continue Khan Academy programming using Java Script https://www.khanacademy.org/cs

NO SCHOOL!

## Tuesday

• Logic and If Statements

## Wednesday (Lab)

• Complete Khan's Javascript course

## Technology Friday

### Cryptography - Part 3 - RSA

#### Summary

RSA is what you use to encrypt the keys and Diffie–Hellman is what you use to exchange the encrypted keys securely

RSA is an algorithm for public-key cryptography that is based on the presumed difficulty of factoring large integers, the factoring problem. RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman

Diffie–Hellman key exchange (D-H)[nb 1] is a specific method of exchanging cryptographic keys. It is one of the earliest practical examples of key exchange implemented within the field of cryptography. The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure.

##### Dillie-Hellman

Cryptographic explanation

The simplest and the original implementation of the protocol uses the multiplicative group of integers modulo p, where p is prime, and g is a primitive root modulo p. Here is an example of the protocol, with non-secret values in blue, and secret values in red.

1. Alice and Bob agree to use a prime number p = 23 and base g = 5 (which is a primitive root modulo 23).
2. Alice chooses a secret integer a = 6, then sends Bob A = ga mod p
• A = 56 mod 23 = 8
3. Bob chooses a secret integer b = 15, then sends Alice B = gb mod p
• B = 515 mod 23 = 19
4. Alice computes s = Ba mod p
• s = 196 mod 23 = 2
5. Bob computes s = Ab mod p
• s = 815 mod 23 = 2
6. Alice and Bob now share a secret (the number 2).