classical cryptosystem
Classical cryptosystems can be divided into two types:
substitution ciphers (column substitution and periodic substitution)
substitution ciphers (single-table substitution and multi-table substitution)
Single-table substitution ciphers can be further divided into shift ciphers , key-based single-table substitution ciphers, and radiation ciphers. A
typical example of multi-table substitution is the Virginia cipher.
Multi-table substitution cryptanalysis: (the same name letter may correspond to incompatible ciphertext letters)
Step 1: Determine the length of the key
Common methods are Kasiski test method and coincidence index method
Step 2: Determine the relative key words
The common method of displacement is the quasi-coincidence index test method (or coincidence mutual index)
. The third step: recover the plaintext according to the key determined in the second step (exhaustive search for the key word)
Fundamentals of Cryptography Information Theory
The concept of entropy,
the basic properties of entropy,
the definition of joint entropy,
the definition of conditional entropy,
the expectation of joint entropy,
mutual information,
perfect secrecy
block cipher
- Design Principles of Block Ciphers: Diffusion, Confusion, and Product Cryptosystems
- Iterative structure of block cipher: Feistel, SP network
The basic structure of DES (effective key is 56bit)
①IP replacement (the obtained 64-bit quantiles are divided into two halves, each 32bit, excluding cryptographic information)
②Round function
③Key arrangement (the purpose is to generate subkeys for round iterations)
Round functions include :
①Extended permutation (also known as E-box): with avalanche effect, 32->48
②Key plus: 48bit and key bit-by-bit
XOR ③S-box: the only non-linear part, which speeds up the diffusion of data , 48->32bit
④ permutation operation (also known as P box): simple position transposition, excluding expansion and compression
Des will be subjected to exhaustive attacks
Double DES: There is a meet-in-the-middle attack, and the password strength is 2^56
Three types of DES: When K1=K3, it will also encounter a meet-in-the-middle attack
attack type
Brute force attack: exhaustive attack, table lookup attack (precomputation and online stage), time storage trade-off attack
Differential attack:
linear attack: linear approximation with high deviation
The basic structure of AES
The key length is 128 bits , and there are dozens of rounds. The packet length is also 128 bits.
Both the key and the plaintext are processed in units of bytes, and 128bit can be converted into a 4×4 byte matrix. It
mainly includes key expansion and round functions.
The round functions include:
①Byte substitution (table lookup operation, that is, S box , the design of the S-box is very ingenious and can prevent various cryptanalysis attacks)
②row displacement (simple left loop operation)
③column mixing (realized by matrix multiplication, the shifted matrix is multiplied by a fixed matrix)
④round Key addition (bit-by-bit XOR operation of the 128-bit round key with the plaintext)
Note: Column mixing is not performed in the last round
In addition, before the first round of iteration, an XOR encryption operation is performed on the plaintext and the original key
stream cipher
Classification:
- Synchronous stream cipher: The generation of the key sequence is independent of the plaintext message and the ciphertext message, so this type of sequence cipher is a synchronous sequence cipher.
- Self-synchronizing stream cipher: The generation of the key sequence is a function of the key and the fixed-size previous ciphertext bits, and this sequence cipher is called self-synchronizing sequence cipher or asynchronous sequence cipher.
LFSR: Linear Feedback Shift Register
In order for an LFSR to generate a maximum periodic sequence m, its generating polynomial must be a primitive polynomial.
Hash function
Hash is also called a hash function and a hash function. It is an irreversible one-way cryptographic system that transforms an input of any length into a fixed-length output .
Hash function iteration structure, also known as MD structure
Hash function application:
- digital signature
- The "digital fingerprint" of the document
- For secure transmission and storage of passwords
The design of the Hash function is mainly divided into two categories:
one is implemented based on the encryption system, for example, the CBC mode of the symmetric block cipher algorithm is used to generate the hash value.
The other is to realize unidirectionality by directly constructing complex nonlinear relationships, such as MD5, SHA1, SHA256.
Hash function attacks: birthday attacks
message authentication code
Message authentication code (message authentication code) is a technology for confirming integrity and performing authentication. It takes the first letter of three words and is referred to as MAC.
Message authentication has two functions: one is to verify the authenticity of the source of the message, and the other is to verify the integrity
of the message
Question:
Improvement plan
Starting from the hash function, it is necessary to perform a hash operation on the data to be sent, and send the hash value and the original data together. It is
necessary to introduce an encryption step when performing the hash operation
Summary of steps
- prerequisites:
- There must be a secret key on the side where the message authentication code is generated and the side that is verified
- The two parties agree to use the same hash function to operate on the data
- process:
- sender:
- send original law message
- Generate a message authentication code from the original message
- ((original message) + secret key) * hash function = hash value (message authentication code) - Send the message authentication code to the other party
- recipient:
- receive raw data
- receive message authentication code
- check:
- (received message + secret key) * hash function = new hash value
- Compare the new hash value with the received hash value
- sender:
public key cryptography
At present, there are three most widely used public key encryption systems: RSA public key encryption system, ELGamal public key encryption system and elliptic curve public key encryption system. (The latter two are based on discrete logarithm problems)
digital signature
message authentication code problem
- disadvantages
- There is a problem with key distribution difficulties
- unsolvable problem
- No third party certification
- cannot prevent denial
Digital signature method:
Implementation method of digital signature:
- RSA-based signature scheme
- Discrete logarithm-based signature scheme