Usually, the encryption or decryption transformation of the data encryption algorithm implemented on the computer is controlled by a key or a group of keys. The key is randomly selected by the user who uses the encryption system. The key is called the only key that can control the conversion between plaintext and ciphertext, usually a random character.
Traditional cryptography usually uses shift method, substitution method and algebraic method to transform encryption and decryption, and one or more of these methods can be used as the basic way of data transformation. Displacement method is also called replacement method. The Shift method rearranges the characters in plain text, and the characters themselves remain unchanged, but their positions have changed. As the simplest example of the shift method, the letters or characters of plaintext are written backwards, and then the ciphertext is sent or recorded in character groups with a specified length, as shown in the following example:
Clear text: Since 1975, data security has developed rapidly.
Ciphertext: 5791ecnisyld iparde vloves Ahy tirucesatad
As another form of shift method, plaintext can be grouped and written backwards, and then ciphertext can be sent or recorded in character groups of specified length, for example:
Plain text: cryptography and data security Liu
Ciphertext: rgotpyrc ddnayhpa rucesata uilybyti
Please note that the latter form of group shift method significantly improves the intelligibility of ciphertext.
The alternative method is to use a lookup table and another plaintext table to correspond to the character table in plaintext, so that the characters in ciphertext should keep their original positions in plaintext, but they have changed themselves. One of the simplest examples of substitution is the cipher alphabet, which consists of plaintext part and ciphertext part:
Clear alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Ciphertext alphabet: CDEFGHIJKLMNOPQRSTUVWXYZAB
When plaintext is converted into ciphertext, the characters in plaintext are replaced by the corresponding characters in the ciphertext symbol table, and the ciphertext adopts the method of allocating records:
Plaintext: Cryptography is a hot research field.
Ciphertext: vjgetarv qnqiakuc jqvtgugc tejctgc
Algebraic encryption can convert the following two plaintext representations:
1. Replace the characters of Ming Dynasty with numbers according to the specified transformation method, and then perform a series of reversible digital operations on the values of these numbers, and the digital results generated after the operations generate ciphertext through the process of inverse initial transformation. It should be noted that encryption by algebraic method must be an error-free digital operation.
2. According to the binary-decimal system, the binary equivalent value of plaintext characters is taken as the input of a set of logical and arithmetic operations, and the generated binary result is changed back to the binary-decimal system as ciphertext.
Generally, algebraic encryption can be automatically calculated by a microcomputer or other types of computers. Algebraic encryption can be used as a method of complex encryption system.
As an example of algebraic method, this paper introduces the encryption system invented by Hill based on solving simultaneous equations. The following is an arbitrary character comparison table:
A B C D E F G H I J K L M
4 8 25 2 9 20 16 5 17 3 0 22 13
National oil company
24 6 2 1 15 23 19 12 7 1 1 18 1 14 10
Note that in the character comparison table, the value range of 26 English letters is 0-25. We take X as the plaintext letter and Y as the secret letter, and adopt a plaintext sequence grouped by four characters. This encryption method is also called quaternary substitution method, and has the following encryption equation:
( 1.2)
( 1.3)
( 1.4)
( 1.5)
According to the encryption equation, the following decryption equation can be given:
( 1.6)
( 1.7)
( 1.8)
( 1.9)
According to the module 26, the processing of digital results in the encryption or decryption process is performed.
Example: For plaintext help, first translate plaintext into the following set of numbers.
( 1. 10)
( 1. 1 1)
( 1. 12)
( 1. 13)
Use the encrypted equation to find its ciphertext value;
( 1. 14)
( 1. 15)
( 1. 16)
( 1. 17)
Thereby obtaining the ciphertext UQZY. In the process of decryption, the decryption equation is used to find its plaintext value for processing.
Data encryption and decryption transformation can adopt one or a combination of more than two methods and algorithms. These methods or algorithms can be varied and ever-changing, and finding simple and effective algorithms has always been a concern of cryptography.
Generally, a cryptographic system consists of the following five parts:
1. Clear information space m;
2. Ciphertext information space c;
3. key space k;
4. Encryption conversion
5. Decryption transformation
For cryptography, the transformation between encryption and decryption is the unity of spear and shield. When establishing and using a cryptographic system, the environment of data encryption must be considered; Password system used by users to protect information security; Deciphering methods and computer tools used by attackers to obtain information.