1 of 27

Cryptography

�Introduction to Cryptography

Symmetric key Cryptography

Asymmetric key Cryptography

Message Authentication

Hash functions

Digital Signatures

Public Key infrastructure.

2 of 27

Introduction to Cryptography

  • Cryptography is the science of using mathematics to encrypt and decrypt data. Cryptography enables you to store sensitive information or transmit it across insecure networks (like the Internet) so that it cannot be read by anyone except the intended recipient.
  • Cryptography is an important aspect when we deal with network security. ‘Crypto’ means secret or hidden. 
  • Cryptography intention of keeping the data secret.
  • Cryptanalysis means breaking of cryptosystems.
  • Cryptology embraces both cryptography and cryptanalysis.

3 of 27

Cryptography

  • Cryptography is classified into symmetric cryptography, asymmetric cryptography and hashing.
  • A cryptographic algorithm, or cipher, is a mathematical function used in the encryption and decryption process. A cryptographic algorithm works in combination with a key — a word, number, or phrase — to encrypt the plaintext. The same plaintext encrypts to different ciphertext with different keys. The security of encrypted data is entirely dependent on two things: the strength of the cryptographic algorithm and the secrecy of the key.

4 of 27

Symmetric key cryptography

  • Secret key with encryption and decryption algorithms .

5 of 27

Asymmetric key cryptography

  • It is known as a public key cryptography because it uses public key with secret key.

6 of 27

Hashing

  • The plain-text and converting it to a hash value of fixed size by a hash function.

7 of 27

Message Authentication

  • message authentication is concerned with:
    • protecting the integrity of a message
    • validating identity of originator
    • non-repudiation of origin (dispute resolution)
  • will consider the security requirements
  • then three alternative functions used:
    • message encryption
    • message authentication code (MAC)
    • hash function

8 of 27

Security Requirements

  • disclosure
  • traffic analysis
  • content modification
  • sequence modification
  • timing modification
  • source repudiation
  • destination repudiation

9 of 27

Message Authentication Code (MAC)

  • generated by an algorithm that creates a small fixed-sized block
    • depending on both message and some key
    • like encryption though need not be reversible
  • appended to message as a signature
  • receiver performs same computation on message and checks it matches the MAC
  • provides assurance that message is unaltered and comes from sender

10 of 27

Message Authentication Code

11 of 27

Message Authentication Codes

  • as shown the MAC provides authentication
  • can also use encryption for secrecy
    • generally use separate keys for each
    • can compute MAC either before or after encryption
    • is generally regarded as better done before
  • why use a MAC?
    • sometimes only authentication is needed
    • sometimes need authentication to persist longer than the encryption (eg. archival use)
  • note that a MAC is not a digital signature

12 of 27

Hash Functions

  • condenses arbitrary message to fixed size

h = H(M)

  • usually assume that the hash function is public and not keyed
    • cf. MAC which is keyed
  • hash used to detect changes to message
  • can use in various ways with message
  • most often to create a digital signature

13 of 27

Hash Functions & Digital Signatures

14 of 27

Requirements for Hash Functions

  1. can be applied to any sized message M
  2. produces fixed-length output h
  3. is easy to compute h=H(M) for any message M
  4. given h is infeasible to find x s.t. H(x)=h
    • one-way property
  5. given x is infeasible to find y s.t. H(y)=H(x)
    • weak collision resistance
  6. is infeasible to find any x,y s.t. H(y)=H(x)
    • strong collision resistance

15 of 27

Simple Hash Functions

  • are several proposals for simple functions
  • based on XOR of message blocks
  • not secure since can manipulate any message and either not change hash or change hash also
  • need a stronger cryptographic function (next chapter)

16 of 27

Hash Functions & MAC Security

  • like block ciphers have:
  • brute-force attacks exploiting
    • strong collision resistance hash have cost 2m/2
      • have proposal for h/w MD5 cracker
      • 128-bit hash looks vulnerable, 160-bits better
    • MACs with known message-MAC pairs
      • can either attack keyspace (cf key search) or MAC
      • at least 128-bit MAC is needed for security

17 of 27

Hash Functions & MAC Security

  • cryptanalytic attacks exploit structure
    • like block ciphers want brute-force attacks to be the best alternative
  • have a number of analytic attacks on iterated hash functions
    • CVi = f[CVi-1, Mi]; H(M)=CVN
    • typically focus on collisions in function f
    • like block ciphers is often composed of rounds
    • attacks exploit properties of round functions

18 of 27

Digital Signatures

  • have looked at message authentication
    • but does not address issues of lack of trust
  • digital signatures provide the ability to:
    • verify author, date & time of signature
    • authenticate message contents
    • be verified by third parties to resolve disputes
  • hence include authentication function with additional capabilities

19 of 27

Digital Signature Properties

  • must depend on the message signed
  • must use information unique to sender
    • to prevent both forgery and denial
  • must be relatively easy to produce
  • must be relatively easy to recognize & verify
  • be computationally infeasible to forge
    • with new message for existing digital signature
    • with fraudulent digital signature for given message
  • be practical save digital signature in storage

20 of 27

Direct Digital Signatures

  • involve only sender & receiver
  • assumed receiver has sender’s public-key
  • digital signature made by sender signing entire message or hash with private-key
  • can encrypt using receivers public-key
  • important that sign first then encrypt message & signature
  • security depends on sender’s private-key

21 of 27

Arbitrated Digital Signatures

  • involves use of arbiter A
    • validates any signed message
    • then dated and sent to recipient
  • requires suitable level of trust in arbiter
  • can be implemented with either private or public-key algorithms
  • arbiter may or may not see message

22 of 27

Authentication Protocols

  • used to convince parties of each others identity and to exchange session keys
  • may be one-way or mutual
  • key issues are
    • confidentiality – to protect session keys
    • timeliness – to prevent replay attacks
  • published protocols are often found to have flaws and need to be modified

23 of 27

Replay Attacks

  • where a valid signed message is copied and later resent
    • simple replay
    • repetition that can be logged
    • repetition that cannot be detected
    • backward replay without modification
  • countermeasures include
    • use of sequence numbers (generally impractical)
    • timestamps (needs synchronized clocks)
    • challenge/response (using unique nonce)

24 of 27

Digital Signature Standard (DSS)

  • US Govt approved signature scheme
  • designed by NIST & NSA in early 90's
  • published as FIPS-186 in 1991
  • revised in 1993, 1996 & then 2000
  • uses the SHA hash algorithm
  • DSS is the standard, DSA is the algorithm
  • FIPS 186-2 (2000) includes alternative RSA & elliptic curve signature variants

25 of 27

Digital Signature Algorithm (DSA)

  • creates a 320 bit signature
  • with 512-1024 bit security
  • smaller and faster than RSA
  • a digital signature scheme only
  • security depends on difficulty of computing discrete logarithms
  • variant of ElGamal & Schnorr schemes

26 of 27

Digital Signature Algorithm (DSA)

27 of 27