Algorithms Flashcards
What is the Formula for Encryption for RSA
C = M^e % n
What is the Formula for Decryption for RSA
M=C^d % n = (M^e)^d % n
Explain Key Generation for RSA
- take distinct Prime Numbers p q, let n=p.q
- let phi(n) = (p-1)(q-1)
- calculate d so that de % phi(n) = 1
Public Key KU = {e ,n}
private Key KR = {d, n}
How can you break RSA
Brute Force Attacks
find p and q for n
Points about the security of RSA
Relies on factoring algorithms
big numbers cannot be factored easily
Requirements for DH algorithm
2 known numbers
1. Prime Number (q)
2. Primitive root of q (a)
Steps Of DH Encryption
- A and B Select random numbers secretly
- A Calculates Ya = alpha Xa% q
- B calculates Yb = alpha Xb% q
- send those over
- they calculate a common secret key using
K = (Ya/bXb/Xa)
What does MAC Stand For
Message Authentication Code
How does MAC work
a hash is found for a message using a shared secret key and added to the end of the message by the sender, the receiver then also calculates the MAC and compares their results
Compare MAC to encryption
MAC is easier to implement and is less vunerable to being broken but cannot be reversed
Compare One-Way Hash functions and MAC
- hash functions do not use a secret key to find the hash unlike MAC
- both easy to implement
Requirements for one way Hash Functions in message authentication
- function must be able to be applied to a block of any size
- function must produce a fixed length
-H(x) must be easy to compute
-for a given h it must be difficult to find x such that H(x) = h
-Strong collision resistance