Docsity

Classic and Modern Encryption Algorithms, Slides of Algorithms and Programming

Partial preview of the text

Download Classic and Modern Encryption Algorithms and more Slides Algorithms and Programming in PDF only on Docsity!

Classic and Modern Encryption Algorithms

Prof. Michel A. Kinsy

CSE/CEN 598

Hardware Security & Trust

Trustworthy Hardware System Design

Authentication Availability Integrity Confidentiality

Trustworthy Systems Distributed Trustworthy Systems Standalone Trustworthy Systems Communication related concerns are minimal

Resilience

Reliability Security Privacy

Isolation Dissociation Obfuscation

Functional Security Properties of Systems

Confidentiality:

  • Secure channels / symmetric

cryptography:

  • One-time pads
  • Stream ciphers
  • Block ciphers
    • Modes of operation
  • Key exchange / key distribution:
  • Public / private cryptography
  • Forward secrecy
  • Obfuscation:
  • Indistinguishability obfuscation
  • Deniable encryption
  • Program obfuscation
  • Opaque predicates
  • Hardware obfuscation
  • Anti-tamper, split manufacturing, …
  • Private lookups, private metadata:
  • Mix networks, oblivious RAM, onion routing
  • Isolation
  • Virtualization, containerization, sandboxing…
  • Secure architectures,
  • Trusted execution engines, secure enclaves
  • Formal verification
  • Zero-knowledge proofs

Functional Security Properties of Systems

Confidentiality:

  • Secure channels / symmetric

cryptography:

  • One-time pads
  • Stream ciphers
  • Block ciphers
    • Modes of operation
  • Key exchange / key distribution:
  • Public / private cryptography
  • Forward secrecy
  • Obfuscation:
  • Indistinguishability obfuscation
  • Deniable encryption
  • Program obfuscation
  • Opaque predicates
  • Hardware obfuscation
  • Anti-tamper, split manufacturing, …
  • Private lookups, private metadata:
  • Mix networks, oblivious RAM, onion routing
  • Isolation
  • Virtualization, containerization, sandboxing…
  • Secure architectures,
  • Trusted execution engines, secure enclaves
  • Formal verification
  • Zero-knowledge proofs

Integrity:

  • Message integrity:
    • Error correction codes
    • (Cryptographic) hash functions
  • Privacy-preserving computation:
    • Multi-Party Computation (MPC):
      • Oblivious Transfer
      • Yao’s Garbled circuits
      • Universal composability
    • Homomorphic Encryption (HE)
    • Hardware Root-of-Trust (HRoT):
      • Physical unclonable functions, e-fuses
    • Federated Learning
    • Distributed Consensus:
      • Digital currency, private voting
  • Software security:
    • Virtual memory, file system permissions
    • App signing, sandboxing
    • Control flow integrity:
      • Shadow stacks
    • Buffer overflow protection:
      • ASLR, stack canaries
    • Malware detection:
      • Antiviruses, malware signatures
      • Hardware performance counters

Functional Security Properties of Systems § Functionality:

  • CIA triad: § Confidentiality § Integrity § Availability
  • Types of security services, according to NIST [1]: - Confidentiality - Data Integrity - Authentication - Authorization - Non-repudiation
  • Not ordered by importance! Functionality Confidentiality Data Integrity Authentication Authorization Non-repudiation [1] Elaine Barker, NIST Special Publication 800-57 Part 1 Revision 5, Recommendation for Key Management.

Functional Security Properties of Systems § Security:

  • Source of security: § Information theoretic security § Computational security - Security nonuniformity
  • Attack & threat models: § threat = possibility of something bad happening § attack = a vulnerability exploited to realize a threat
  • Adversary capability: § Computational model § Computational resources
  • Domain properties: § Secure channels § Trusted parties / hardware § Domain assumptions
  • Again, not ordered by importance! Confidentiality Data Integrity Authentication Authorization Non-repudiation Functionality Security Source of security Attack / threat model Adversary capability Domain properties

Computer Systems Security

§ Processing - Data in manipulation

  • Program obfuscation
  • Opaque predicates
  • Virtualization, containerization, sandboxing
  • Secure architectures,
  • Trusted execution engines, secure enclaves

§ Communication - Data in motion

  • Secure channels / cryptography
  • Key exchange / key distribution
  • Forward/backward secrecy
  • Oblivious Transfer

§ Storage - Data at rest

  • Certificate authorities
  • Root certificates,
  • Self-signed certificates
  • Message authentication codes

§ System-in-Use - Side-Channel

  • Control flow integrity
  • Shadow stacks
  • Buffer overflow protection:
  • ASLR, stack canaries

§ Supply-Chain Trust Issues

  • Hardware obfuscation
  • Anti-tamper
  • split manufacturing

Computer Systems Security

§ Processing - Data in manipulation

  • Program obfuscation
  • Opaque predicates
  • Virtualization, containerization, sandboxing
  • Secure architectures,
  • Trusted execution engines, secure enclaves

§ Communication - Data in motion

  • Secure channels / cryptography
  • Key exchange / key distribution
  • Forward/backward secrecy
  • Oblivious Transfer

§ Storage - Data at rest

  • Certificate authorities
  • Root certificates,
  • Self-signed certificates
  • Message authentication codes

§ System-in-Use - Side-Channel

  • Control flow integrity
  • Shadow stacks
  • Buffer overflow protection:
  • ASLR, stack canaries

§ Supply-Chain Trust Issues

  • Hardware obfuscation
  • Anti-tamper
  • split manufacturing

One-Time Pads

§ Basic idea:

  • Alice and Bob exchange a codebook containing a stream of random numbers
  • When Alice wants to send Bob a message, she reads numbers from the codebook
  • Alice XORs the plaintext with them to create ciphertext
  • Alice sends ciphertext over an insecure channel
  • Bob performs the same steps to retrieve the plaintext
  • Both cross out used numbers § Upsides:
  • Perfect provable secrecy
  • Plausible deniability § Downsides:
  • “Key” is as large as the text
  • Must be communicated ahead of time
  • Cannot use encryption to send one-time pad if encryption is already using a one-time pad

Symmetric Cryptography

§ Encryption

  • Input data, i.e., plaintext plus a secret key
  • Output is the ciphertext § Decryption is the inverse function Plaintext (m) Ciphertext^ (c) secret key ( k ) Encryption Enc() Plaintext (m) Ciphertext (c) secret key ( k ) Decryption Dec()

Aspects of Cryptography

§ General categories of algorithms

  • Stream Ciphers § Operate on a variable-length stream § Generate a pseudo-random key stream and XOR with the plaintext § The algorithm key serves as the seed of the pseudo-random stream generator
  • Block Ciphers § Operate on blocks of predefined sizes CRYPTOGRAPHY Private Key (Secret Key) Public Key Block Cipher Stream Cipher Integer Factorization^ Discrete Logarithm

Stream Ciphers

§ Generate a stream of pseudo-random bits § XOR bits with plaintext to create ciphertext § To decrypt text, run RC4 in reverse

  • What does it mean to run “in reverse”?
  • Encryption and decryption must be perfectly aligned to work § Upsides:
  • Very efficient implementation
  • No restrictions on plaintext size
  • Single-bit errors do not break rest of cipher § Downsides:
  • By definition, stream ciphers operate on bits
  • A single ciphertext bit is a function of the key and a single plaintext bit § No avalanche effect^ w.r.t.^ the plaintext
  • Does this sound familiar? § Cipher feedback (CFB) can help (discussed in a couple of slides)
  • Malleable! Hash function Key Nonce Counter Constants Plaintext (^) ⊕ Ciphertext

Example Block Cipher

§ 2 bit block cipher, 2 bit key with encryption function defined by m c 00 11 01 10 10 01 11 00 m c 00 10 01 11 10 01 11 00 m c 00 01 01 00 10 11 11 10 m c 00 11 01 00 10 01 11 10 Key 00 Key 01 Key 10 Key 11

Block Ciphers as Hash Functions

§ Iterate over all of the b blocks § Use the output value from the previous block as input to the current block

  • x 0 is a constant m 1 m 2 x 0 x 1 x 2 h’ h’ m 3 x 3 h’ mb xb h’ =h(m)