470 likes | 584 Views
Network Security. Chapter 1. Security and Cryptography. Objectives. Describe 5 security services. Understand Block ciphers and designing factors. Understand Modes of Block ciphers. Understand Stream ciphers OTP (One Time Password) DOS Attack and firewall. A Secure Communication Network.
E N D
Network Security Chapter 1. Security and Cryptography
Objectives • Describe 5 security services. • Understand Block ciphers and designing factors. • Understand Modes of Block ciphers. • Understand Stream ciphers • OTP (One Time Password) • DOS Attack and firewall.
A Secure Communication Network • Provides security services … • Confidentiality • Integrity • Authentication • Nonrepudiation • Service Reliability
Confidentiality • Encryption Algorithm • Encryption : E(M) = C • Decryption : D(C) = M • Symmetric Key Encryption • A and B : agree on a cryptosystem(Cipher to be used) • A and B : agree on the key to be used. • A : encrypts messages and send to B • B : decrypts the ciphertext .
Confidentiality • Asymmetric(Public) Key Cryptography • depends on trapdoor one way function (ex) product of two large prime number • PKC is very slow. • does not need to agree on the key • A and B : agree on a cryptosystem(Cipher to be used) • B : sends its public key to A. • A : encrypts M using B’s Public Key. • B : decrypts the cipher text using it private key.
Confidentiality • Hybrid Cryptography • Exploit the speed of SKC and use PKC to solve the Key distribution of SKC. • A and B : agree on a cryptosystem • B : sends its public key to A. • 4. : session key transmission using PKC. • 5. Use session key to communicate securely
Integrity • Use message authentication code(MAC) • use hash function to calculate MAC. message Hash Hash MAC MAC MAC ?
Authentication • Scenario - Eve plans to rob bank customers by masquerading as them. - No provision of authentication. • Digital Signatures • Challenge-response schemes.
Authentication • Digital Signature – Message & Entity Authentication message Hash Hash MAC MAC ? MAC Sign value verifying algorithm Signing algorithm Signer’s private key Signer’s public key http://www-cse.ucsd.edu/users/mihir/cse207/w-mac.pdf
Authentication • Challenge-response schemes. – Entity Authentication • A and B : agree on a cryptosystem • A : sends its public key to B. • B : sends random number(RN) to A. • A : encrypt RN with its private key • B : B decrypt A’s message and check if two RNs are same.
Replay protection and Nonrepudation • Replayprotection : • Protection against reuse of an entity(digital check) or protocol message for one time use. • Timestamp • Norepudiation : requires the involvement of a trusted third party
Block ciphers • DES(Data Encryption Standard) • K : 56 bit, M : 64 bits, 16 round, Feistal Network. • AES(Advanced Encryption Standard) • n = 128, k = 128, 192, or 256 http://www-cse.ucsd.edu/users/mihir/cse207/w-bc.pdf [AES] http://en.wikipedia.org/wiki/Advanced_Encryption_Standard [DES] http://en.wikipedia.org/wiki/Data_Encryption_Standard http://www.forum2.org/eran/SKC2004/des.pdf
Block ciphers • Basic techniques : diffusion and confusion to avoid statistical analysis. [Claude Shannon] • Diffusion : • For a single bit change in the plaintext, how many bits change in the cipher text. • Dissipates the redundancy of the plaintext by spreading it over the ciphertext. • By permutation • Confusion : • make the relationship between the statistics of the ciphertext and the value of the encryption key as complex as possible, • to thwart attempt to discover the key. • by substitution
Block ciphers Substitution Permutation
Block ciphers • AES main operations Confusion diffusion diffusion confusion
Using the Cipher : The Modes • ECB : Electronic-Codebook mode (Block ciphers) • Advantage : Simple, no error Propagation, can be parallelized • Disadvantage : one-to-one mapping repeat-in-plaintext repeat-in-ciphertext re-ordering and replay attack to modify the message.
Using the Cipher : The Modes • CBC : Cipher block Chaining Mode (Block Ciphers) • Advantage : self recovering from errors error in the Ci effects only Pi and Pi+1 • Disadvantage : flipping a bit in Ci will flip the correspond bit in Pi+1 IV
Using the Cipher : The Modes • OFB : Output Feedback Mode(Stream Cipher) • Advantage : key-stream can be pre-computed, no error propagation • Disadvantage • Is not self synchronizing (in case of cipher text lost) • Susceptible to known plain-text attack. [J. Franklin]http://pages.cs.wisc.edu/~detmer/SurveyAsynchExt.pdf
Using the Cipher : The Modes • CTR : Counter-mode • Advantages : preprocessing, Random access, software and hardware efficiency, parallel processing. • Disadvantages : Sensitive to usage errors (counter value reuse) http://www.cs.ucdavis.edu/~rogaway/papers/ctr.pdf
Synchronous Stream Ciphers • Synchronous : Key stream is generated without use of the plaintext and of ciphertext • Advantage : no error propagation • Disadvantage : bit insertion or deletion in ciphertext - lose sync and corrupt rest of plaintext. • Insertion attack – the weakness of key reuse
Self-Synchronizing Stream Ciphers • Self-synchronizing( or Asynchronous) : the key stream is generated as a function of the key and a fixed number of previous ciphertext units. • Advantage : more secure then synchronous stream cipher. • Disadvantage : - error propagation. - slow – no pre-computation of key stream.
Cryptographic Hash function • A hash function takes a long string (or 'message') of any length as input and produces a fixed length string as output, sometimes termed a message digest or a digital fingerprint. • The desirable • Preimage resistant : given h it should be hard to find any m such that h = hash(m). (one-way function) • Second preimage resistant: given an input m1, it should be hard to find another input, m2 (not equal to m1) such that hash(m1) = hash(m2). This property is implied by collision-resistance. • Typical hash length : 128, 160, 192, 256 • Standards : MD5, RIPEMD, SHA, Whirlpool
What’s inside a cryptographic hash? < general message block processing> • One MD5 operation • MD5 consists of 64 of these operations, grouped in four rounds of 16 operations. • F is a nonlinear function; one function is used in each round. • Mi denotes a 32-bit block of the message input, and Ki denotes a 32-bit constant, different for each operation.
MD5 execution example. • Many Unix and Linux systems provide the md5sum
Applications of Hash function • Saving hash of a password instead of password itself. digitally signing a document
Keyed-Hash Message Authentication Code, or HMAC • used to simultaneously verify both the data integrity and the authenticity of a message. [RFC2104] http://tools.ietf.org/html/rfc2104 [fips198] http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf
OTP (One Time Password) User and Server share sequences of one time password or a OTP generation algorithm so that they can generate same passwords in synchronized manner.
OTP (One Time Password) - Deployment OTP generator cyworld Portal Login
OTP (One Time Password) - Deployment OTP 금융통합인증 서비스
Hard Problems in Public key Cryptography • Integer factorization problem Giver integer n, find its prime factorization; that is write where the are pair-wise distinct primes and each • Application RSA problem : Given a positive integer n that is a product of two distinct odd primes p and q, a positive integer esuch that gcd(e, (p-1)(q-1))=1 and an integer c, find an integer m such that
Hard Problems in Public key Cryptography • DefinitionLet G be a finite cyclic group of order n. Let be generator of G and LetThe discrete logarithm of to the base , denote is the unique integer x, , such that . • The Discrete Logarithm Problem(DLP) Given a prime p, a generator of , and an element , find the integer such that . The order of is p-1, that is , so
Hard Problems in Public key Cryptography • Application of DLP - ElGamal public key encryption. - Diffie-Hellmam Problem(DHP) Given a prime p, a generator g of , and elements mod p, and mod p, find mod p.
Decision Deffie-Hellman(DDH) Assumption • DDH is the problem of distinguishing triplets of the form (gr, gs, grs) from triplets of the form (gr, gs, gt), where r, s and t are random exponents., • More formally suppose r, s and t are randomly chosen and h is chosen dependent on random bit b with • We often call (gr, gs, grs) a Diffie-Hellman triplet. • DDH Assumption: There is no efficient algorithm which can solve with non-negligible advantage.
Elliptic curve cryptography • Elliptic curves may be used to form elliptic curve groups. • A group is a set of elements with custom-defined arithmetic operations on those elements. • For elliptic curve groups, these specific operations are defined geometrically. • Elliptic curves groups are examined with the underlying fields of Fp (where p is a prime) and F2m (a binary representation with 2m elements). • ECC related Math : refer this linkhttp://www.certicom.com/index.php?action=ecc,math
Elliptic Curve Groups over Real Numbers • Elliptic Curve equation : • y2 = x3 + ax + b, where x, y, a and b are real numbers. 4a3 + 27b2 ≠ 0, EC point (x, y) form a group. • EC group : { points over a EC curve, O (point at infinity) }
Elliptic Curve Addition: A Geometric Approach • Adding : P + Q = R • if P=(x1,y1), -P = (x1, -y1) P + (-P) = O
Elliptic Curve Addition: A Geometric Approach • Doubling the point P if yP = 0 3P = P, 4p=O, 5P=P
Elliptic Curve Addition: An Algebraic Approach • Adding distinct points P and Q- P(xP, yP) + Q(xQ, yQ) = R(xR, yR) s = (yP - yQ) / (xP - yQ) xR = s2 - xP - xQ and yR = -yP + s(xP – xR) • Doubling the point P- When yP is not 0, 2P = R where s = (3xP2 + a) / (2yP ) xR = s2 - 2xP and yR = -yP + s(xP - xR) • Experiment & Quiz: http://www.certicom.com/index.php?action=ecc_tutorial,ecc_tut_2_3
Elliptic Curve Groups over Fp • The field Fp : • uses the numbers from 0 to p – 1. • any operation within this field also result in this field. • For example, F23 = {0,1,…,22} • An EC over Fp : y2 (mod p) = x3 + ax + b (mod p), • Example : http://www.certicom.com/index.php?action=ecc_tutorial,ecc_tut_3_1 • Experiment & Quiz : http://www.certicom.com/index.php?action=ecc_tutorial,ecc_tut_3_3
Elliptic Curve Groups over F2m • The F2m are m-bit strings. ={000, 001,010,011,100,101,110,111} • The rules for arithmetic (addition, subtraction, multiplication, inversion) in F2mpolynomial representationoptimal normal basis representation. • An EC : y2 + xy = x3 + ax2 + b, • Example, Experiment, Quiz : http://www.certicom.com/index.php?action=ecc_tutorial,ecc_tut_4_1
Elliptic Curve Discrete Logarithm Problem (ECDLP)- Hard Problem • Scalar Multiplication : for give m and P, calculate mP • Given points P and Q in the group, find a number k such that Pk = Q. • Example : http://www.certicom.com/index.php?action=ecc_tutorial,ecc_tut_5_3_1
Elliptic Curve Pairings • Triple of Group G1,G2,GT • A mapping e : G1 x G2 GT which is bilinear: • e(P+Q, R) = e(P, R)▪e(Q, R) • e(P, R+S) = e(P, R)▪e(P, S) • Hence e(aP, bP) = e(P, R)ab = e(bP, aR) • Non-degeneracy: e(P, R) ≠ 1 for some P G1, R G2. • Computability : e(P, R) can be efficiently computed.
Elliptic Curve Pairings • G1 and G2 are subgroups of the group of points on an elliptic curve E defined over a field Fq. Hence additive notation for G1 , G2 . • Typically all groups G1, G2 , GT are of prime order r. • GT is a subgroup of . • Hence multiplicative notation for GT . • If G1 = G2 then we call the pairing symmetric. For now consider only symmetric pairings. • If e is a non-degenerate system pairing and P generates G1then e(P, P) generates GT.
Beyond of Cryptography. • Firewalls :
Beyond of Cryptography. • Denial of service attacks
Resources • Message Authenticationhttp://www-cse.ucsd.edu/users/mihir/cse207/w-mac.pdf • Block Cipherhttp://www-cse.ucsd.edu/users/mihir/cse207/w-bc.pdf • AEShttp://en.wikipedia.org/wiki/Advanced_Encryption_Standard • DEShttp://en.wikipedia.org/wiki/Data_Encryption_Standardhttp://www.forum2.org/eran/SKC2004/des.pdf • Blockcipher based stream cipher attack :http://pages.cs.wisc.edu/~detmer/SurveyAsynchExt.pdf • Security analysis of CTR Modehttp://www.cs.ucdavis.edu/~rogaway/papers/ctr.pdf