What is symmetric encryption Codehs?

#Key Exchange For both symmetric and asymmetric encryption, there has to be a secure way to share keys between the sender and the receiver. This is called a *key exchange*. A key exchange is a method in cryptography by which keys (public or private) are exchanged between two parties. Since the same key is used to encrypt and decrypt data in symmetric encryption, the key must be shared with the receiver to be able to decrypt the message. Sharing this key between parties must be done in a very secure manner since anyone who intercepts it can now decrypt the message as well! Asymmetric encryption utilizes two different keys, one to encrypt data and the other to decrypt the data. One key is shared publicly, and the other is kept private. The “trick" of a good key exchange is that it should be relatively easy to encrypt but very difficult to attempt to work backward through the encryption steps. Working backward through the steps is called *reverse engineering*. #Modulo Math Ensuring good encryption and key exchange techniques relies on understanding some math. One calculation that is very helpful in creating strong encryption functions is the use of modulo math. It is very important in cryptography because modulo math can act as a one-way function where the output hides the input really, really well. It allows for the ability to write really strong encryption functions. You might think, what is this modulo math? Believe it or not, you might already know some modulo math from elementary math, but you’ve never called it that before. Basically, modulo is the math of remainders when you do a division problem. **Example 1:** 10 mod 3 = *How many times does 3 divide evenly into 10?* 3 times (3 x 3 = 9) *What is the remainder?* 10 - (3 x 3) = 1 Answer: 10 mod 3 = 1 **Example 2:** 19 mod 8 = *How many times does 8 divide evenly into 19?* 2 times (8 x 2 = 16) *What is the remainder?* 19 - (8 x 2) = 3 Answer: 19 mod 8 = 3 **Example 3:** 8 mod 2 = *How many times does 2 divide evenly into 8?* 4 times (2 x 4 = 8) *What is the remainder?* 8 - (2 x 4) = 0 Answer: 8 mod 2 = 0 #You Try! >