1. The historical milestones of cryptography
1. Caesar password
In ancient times, communication was difficult, and the messenger was afraid of being ambushed by the enemy, and the content of the letter would be known by the enemy
When encrypting text, you only need to shift the letter 3 digits to the right, when decrypting, you only need to shift 3 digits to the left
Therefore, the Caesar password also needs ROT3 (rotation 3)
The Caesar password is simple to use and easy to decipher. When faced with frequency analysis, the Caesar password is very fragile
The most frequently used letters in English are: E, T, A, O, N, R, I, S, H
Alibaba Cloud Simple Application Server: Anti COVID-19 SME Enablement Program
$300 coupon package for all new SMEs and a $500 coupon for paying customers.
2. American Civil War
Use complex text replacement and shift combinations, and strive to make the enemy decipher in vain
Wind Whisperer (World War II)
During the early days of World War II, on the Pacific battlefield, the Japanese army could always use various methods to decipher the secret code of the US army, which caused the US army to suffer on the battlefield. In order to change this situation, 29 Indian Navajos were drafted into the army in 1942. Because their language was not understood by foreigners, the US military trained them into specialized translators, known as "wind whispers." As the secret weapon of the U.S. Navy, each "wind whisperer" shoulders the highest secrets of the U.S. military. Therefore, they have also received special "care" - each Navajo translator is personally attached to a naval soldier Protection, on the one hand to ensure his personal safety, on the other hand, if the translator is about to be captured by the Japanese army, the protector must kill him to ensure that the password is not leaked.
3. Ultra and Enigma
Enigma: Before World War II, a German military-industrial company transformed a commercial code machine for the government, named Enigma. This machine uses a series of 3 to 6 digits to execute a complex replacement code for the machine. Under the technical conditions at the time, the only feasible way to decrypt was to use a similar machine with the same rotation settings used by the transmission equipment. The Germans attached great importance to the protection of these equipment and set up heavy defenses, making it almost impossible for the allies to obtain one.
Ultra: In order to attack the Enigma code, the Allied forces started a top secret operation, code-named Ultra. It wasn't until the Polish army successfully built an Enigma prototype and reported their findings to British and American cryptographers that the efforts of the allies bore fruit. Under the leadership of Turing, the Allies successfully cracked the Enigma code in 1940.
During the Second World War, the Allied forces suffered from the inability of the German cryptographic system "Ingmar" to decipher. The government convened a group of mathematicians and logicians to carry out secret cracking work. Turing was one of them. At the beginning of the cracking plan, Turing was rejected by the leaders. Fortunately, the director of MI6 helped him set up a project to research the machine that decrypts codes. Turing became the person in charge and recruited a new member, Joan, to start the difficult work. Joan quickly became fascinated by Turing. Thanks to her help, the unprecedented unity of all team members, and successfully cracked the German code two years later. Turing was once engaged to Joan, but he concealed a secret, because of this secret he eventually suffered inhuman treatment...
2. Basic knowledge of cryptography
1. The goal of cryptography
The basic goals of cryptography: confidentiality, integrity, identity verification, non-repudiation
1) Confidentiality: to ensure that data is always kept private in three different states: static, transmission and use
2) Integrity: to ensure that the data has not been changed without authorization
3) Identity verification: verify the identity claimed by the system user
4) Non-repudiation: Assure the receiver that the message comes from the sender and no one impersonates him
2. Password type
Code code: Act on words and phrases
Password: Act on characters and bits
Shift password: rearrange the letters of the plaintext message through an encryption algorithm to form a ciphertext
Replacement password: replace each character or bit of the plaintext message with a different character through an encryption algorithm
Word codebook: a single-time cipher-based plaintext message uses a different replacement alphabet for each letter. The codebook is randomly generated and used only once. The key length is at least as long as the plaintext. It is a very strong replacement password.
Sports key password: Because of the need to physically exchange the codebook, it is very difficult to execute a single codebook, so the sports codebook was invented. Choose an ordinary book and specify the key as a section of the book.
Block cipher: Calculate on the message block and execute the encryption algorithm on the entire message at the same time
Stream password: one character or one bit of the message at a time
3, modern cryptography
1. Password key
Modern cryptosystems do not rely on the confidentiality of the algorithm, but open source the algorithm, and its security relies on the cryptographic key.
2. Symmetric key algorithm: use the same key for encryption and decryption
Key distribution is the main issue: how to agree on the same key
Symmetric key encryption does not provide illegibility, because both C and S have keys
The algorithm lacks scalability and is the scale complexity of n square
The key must be regenerated frequently, and it is expensive to join and leave
3. Asymmetric key algorithm
Each user has two keys, a public key and a private key. The public key is public, and the private key is known only by itself. Use public key encryption, only private key can decrypt. Use private key to encrypt, only public key can decrypt. Advantages of public key cryptosystem:
When adding a new user, you only need to generate a public key private key pair
Facilitate removal of users from asymmetric systems
Only need to regenerate the key when the user's private key is broken
Asymmetric key encryption provides integrity, authentication and non-repudiation
Key distribution is simple and easy
No need to establish communication association in advance
4, symmetric key
1. Data encryption standards
The US government issued a data encryption standard in 1977. DES is a 64-bit block cipher with a key length of 56 bits.
DES generates ciphertext through a long series of XOR operations, after 16 rounds of encryption
2. Triple DES
Variation 1: Use 3 different keys (K1, K2, K3) to encrypt the plaintext three times
Variant 2: Use 3 different keys (K1, K2, K3), K1 encryption, K2 decryption, K1 encryption
Variant 3: Use 2 different keys (K1, K2), K1 encryption, K2 encryption, K1 encryption
Variant 4: Use 2 different keys (K1, K2), K1 encryption, K2 decryption, K1 encryption
3. International data encryption algorithm IDEA
IDEA is also calculated on a 64-bit plaintext block, but IDEA uses a 128-bit key, which is decomposed into 52 16-bit sub-keys for a series of calculations, mainly used in PGP's good privacy secure mail software package in.
4. Blowfish
The Blowfish block cipher is an alternative to DES and IDEA. It is also calculated on a 64-bit plaintext block, but its key length is variable, from 32 to 448, and is often used in SSH.
5. Skipjack
Skipjack is also calculated on 64-bit plaintext blocks, it supports encryption key escrow, and the key length is 80.
6. Advanced encryption standard AES
NIST announced in 2001 that AES was used instead of DES. AES is calculated on 128-bit plaintext blocks, the key length is 128, 192, 256, and the difference is 64.
7. Symmetric key management
Create and distribute symmetric keys: offline distribution, public key encryption, Diffe-Hellman (evolved from RSA)
Storage and destruction of symmetric keys: After the employee leaves, the keys he knows must be replaced
Key escrow and recovery: fair cryptosystem, trusted encryption standard