Cryptography
Cryptography
Domain Objectives
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Concepts and Definitions
• Binary math
• Key management – refers to the principles and practices of protecting the keys throughout the lifecycle
• Key expiry/cryptoperiod – keys should be changed on a regular basis. Length of time should be based on
algorithm and level of protection required
• Key mixing/Key schedule – DES nominal length 56 bits (actual length 64 but 8 used for parity), does 16
rounds of substitution and transposition and uses 48 bits of the key. Generates new 48 bit key from original
56 bit. AES uses key schedulers to generate completely new keys from the original key for each round.
• Keystreams – pseudo-random sequence that is generated from the input key and mixed with the input
message.
• Synchronous – keystream is generated based on original key, bit-by-bit, in sync with plaintext
• Non or self-synchronous – keystream is generated based upon previously generated ciphertext and
cryptovariable
• Key storage – key must be protected in transit and storage
• Key clustering – term used to represent a weakness that exists in a cryptosystem if two different keys
generate the same ciphertext from the same plaintext
Initialization Vector (IV)
• States that the strength of a cryptosystem is based on the secrecy of the key
and not on the secrecy of the algorithm.
• Work factor for the cryptanalyst is the effort required to determine the correct
key.
• Key length is the primary method used to determine the strength of the
cryptosystems.
• Brittleness – measure of how badly a system fails. A resilient system is
dynamic and designed to fail only partially or degrade gracefully. In general,
automated systems which only do one thing are be definition brittle.
• “Security by Obscurity” – concept that system is secure as long as no one
outside the “group” is allowed to find out anything about its internal
mechanisms.
Key Algorithms
• Symmetric key – same key used for both the encryption and
decryption operation
• Message integrity
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Historical Development
• Cryptographic techniques
• Manual – cryptographic methods performed by hand using a variety of
tools (still used on some one-time pads)
• Mechanical – use of mechanical tools to perform encryption and
decryption (cipherdisk)
• Electro-mechanical –use of electro-mechanical devices (Enigma
machine)
• Electronic – computer based tech used to perform complex and secure
cryptographic operations (software and hardware based algorithms – AES,
RSA, etc.)
• Quantum cryptography – using single photon light emissions to provide
secure key negotiation
Domain Objectives
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Uses of Cryptography
• Protecting information
• Transit
• Email, VPNs, e-commerce, VOIP, etc.
• Storage
• Disk encryption
• System access
• Passwords, remote login
Domain Objectives
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Making Secure Algorithms
• Keystream
• Statistically unpredictable and unbiased
• Not linearly related to the key
• Operates on individual bits or bytes
Uses of Stream Cipher and Stream-Mode
Block Ciphers
• Wireless
• Audio/video streaming
• SRTP (Secure Real-time Transport Protocol)
Block Cipher
• Data transport – SSL, TLS. Both protocols can use AES and Triple
DES. IPSec based VPNs also use block ciphers to encrypt
communication between endpoints
• Data storage – even though block ciphers take more time, used
because of their greater ability to frustrate cryptanalysis. TrueCrypt
is an example of block cipher used to encrypt data
Domain Objectives
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Simple Substitution Ciphers
• Substitution of one value for another
• Caesar Cipher
• Shift alphabet (by 3)
• A B C D E F …. FACE
• D E F G H I …. IDFH
• Scramble alphabet
• A B C D E F …. FACE
• Q E Y R T M …. MQYT
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 Z A B C D E F G H I J K L M N O P Q R S T U V W X Y
2 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
3 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
4 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
…
• Unbreakable algorithm
• Mathematically proven that it can never be broken
Steganography
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Modes of Symmetric Block Ciphers
• Block Modes
• Electronic Code Book (ECB)
• Cipher Block Chaining (CBC)
• Stream Modes
• Cipher Feed Back (CFB)
• Output Feed Back (OFB)
• Counter (CTR)
• Counter with CBC-MAC (CCMP)
Electronic Code Book (ECB)
• Similar to CBC
• IV is encrypted and then XOR’d with the first plaintext block
Output Feed Back (OFB)
• Similar to OFB
• Counter value is used instead of an IV
Counter With CBC-MAC (CCMP)
• Blowfish
• Twofish
• CAST
• SAFER
• Serpent
RC-4
• Many applications
Strengths & Weaknesses – Symmetric
Ciphers
Strengths Weaknesses
• Fast • A different form of key
• Difficult to crack negotiation/ exchange/
distribution must be used
• Algorithms and tools freely
available • Poor scalability
• Stream ciphers ensure highly • Limited security
efficient serial communications • On noisy channels, error
• Block ciphers offer multiple correcting is a must
modes
Asymmetric Key Cryptography
• Diffie-Hellman, 1976
• Ensures confidentiality
• Encrypting message with the receiver’s public key provides confidential transmission
of the message because the only key that can open the message is the
corresponding private key of the recipient
• Merkle-Hellman knapsack
• Developed in 1978
• Chor-Rivest knapsack
• Developed in 1984 and revised in 1988
Strengths Weaknesses
• Confidentiality/privacy • Computationally
• Access control intensive
• Authentication • Very slow
• Integrity
• Non-repudiation
Common Hash Functions
• Message Digest
• MD2, MD4, MD5
• Secure Hash Algorithm (SHA)
• SHA-1 (160 bit), SHA-256, SHA-384
• SHA-512 (best practice)
• SHA-3
• HAVAL
• RIPEMD
• Tiger
• WHIRLPOOL
Hash Function Characteristics
• One-way function
• Non-linear relationship
• E-commerce
• Non-repudiation of origin (with private key)
• Key distribution
• Key storage
• Key change
• Expire – how long to use a key
Functions of Key Management
• Operations
• Dual control – require the active participation of 2 or more. No one
person can misuse.
• Threshold schemes – require more than one person to
successfully complete the task
• Key recovery
• Split knowledge – 2 or more people have info about the key. Must
be combined to work.
• Multi-party key recovery – break the key into 3 or more parts and
each part go to a different person.
• Escrow – Key held
Functions of Key Management
• Creation
• Automated key generation – prevents user bias and provides quick
key production
• Truly random – only true random generators are things like radioactive
decay, noisy diodes, etc. Computers produce pseudo-random.
• Suitable length – generators must generate enough bits for a complete
key. Generating 64 bits and concatenating them does not make them
128.
• Key encrypting keys (KEK) – keys used to encrypt other keys. Care
must be taken to ensure that the data used to generate the KEK is
NOT related to the keys being produced.
Functions of Key Management
• Distribution
• Out of band – does not guarantee security delivery, but it increases its
likelihood
• Public key encryption – most common solution
• Secret key construction – using D-H (or similar), exchange values online that generate a
new secret key
• Secret key delivery – using RSA (or similar), party encrypts secret key with receiving
party’s public key.
• Key distribution center – think Kerberos
• Certificates – used to distribute public keys
• Storage
• Trusted hardware – hardware evaluated (typically) by FIPS 140-2 or Common
Criteria
• Smartcard – non-volatile storage
Public Key Infrastructure (PKI)
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Cryptanalysis
Bits Number of keys Brute Force Attack Time Bits Number of keys Brute Force Attack Time
56 7.2 x 10^16 56 7.2 x 10^16 20 hours
80 1.2 x 10^24 80 1.2 x 10^24 54,800 years
128 3.4 x 10^38 128 3.4 x 10^38 1.5 x 10^19 years
256 1.15 x 10^77 256 1.15 x 10^77 5.2 x 10^57 years
• Data shown is as of 1998 when “Deep Crack” was used in RSA DES
challenge.
• Cost $250,000 to build. Today the same thing can be done for under
$10,000.
• With today’s tech, can break DES in 8.7 days or less for under $10,000.
Plaintext Attacks
• Ciphertext only – assume attacker has samples of encrypted text but not
the algorithm, key or system. Most difficult attack because the attacker
has the least to work with.
• Stream
• Frequency analysis – knows characteristics of plaintext language
• IV or keystream analysis – examines large numbers of generated IVs for
weaknesses, statistical biases, etc.
• Block
• Linear cryptanalysis – large amounts of plaintext and associated ciphertext to
find info about the key
• Differential cryptanalysis – 2 or more similar plaintexts are encrypted using
same key and compared
• Linear-differential cryptanalysis – combo of linear and differential
• Algebraic attacks – examines the algorithm
• Frequency analysis – uses the statistics of the language to break a ciphertext
Attacks Against Hash Functions
• Dictionary Attacks
• Based on known lists of common words
• Birthday attacks – group of 23 people, 50% chance 2 will have same birthday. 60
people, 99% chance. Relevant because it describes the amount of effort that must be
made to determine when 2 randomly-chosen values will be the same (collisions). Weak
hash causes many collisions
• Persuasion
• Meet-in-the-Middle
• Mathematical analysis that attacks a problem from both ends and
attempts to find the solution by working toward the center of the
operation from both sides.
• Man-in-the-Middle
• Attacker intercepts and modifies the data before transmitting to
intended person.
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations
Common Secure Email Protocols
• Uses
• Remote Access
• VPNs
• E-commerce
• Tools
• IPSec
• SSL/TLS
• Secure HTTP
• TLS
Cryptography Domain Summary
• Definitions
• History
• Uses
• Cryptographic Methods
• Encryption Systems
• Algorithms
• Cryptanalysis and Attacks
• Implementations