Current location - Training Enrollment Network - Mathematics courses - Mathematics in cryptography
Mathematics in cryptography
Password is a confusing technology, hoping to turn normal (identifiable) information into unrecognizable information. Of course, for a small number of people, these unrecognizable information can be reprocessed and recovered. Password is a general term for "password" in Chinese. In fact, the "password" entered when logging in to websites, e-mails and withdrawing money from banks should be strictly called "password" because it is not the original "encryption code", but it can also be called a secret number. A symbolic system (such as a message) that is mainly limited to personal understanding. Such as cipher telegrams and cipher typewriters.

The encryption and decryption of "encryption code" can not be separated from the support of mathematics. With the development of mathematics, the encryption method and decryption difficulty of passwords have also risen sharply.

Encryption method

RSA algorithm

RSA algorithm is the first algorithm that can be used for both encryption and digital signature, and it is also easy to understand and operate. RSA algorithm is an asymmetric encryption algorithm. The so-called asymmetry means that the algorithm needs a pair of keys. If one is used for encryption and the other is used for decryption.

RSA algorithm involves three parameters, n and e1.e2. Where n is the product of two large prime numbers p and q, the number of bits occupied by the binary representation of n is the so-called key length. E 1 and e2 are a pair of related values, and e 1 can be taken at will, provided that e 1 and (p- 1)*(q- 1) are coprime (coprime: when two positive integers are only 1). Select e2 again and ask (E2 * e1) mod ((p-1) * (q-1)) =1.

(n and e 1), (n and e2) are key pairs.

RSA encryption and decryption algorithms are exactly the same. If a is plaintext and b is ciphertext, then: a = a = b e1mod n; ; b=a^e2 mod n;

E 1 and e2 can be used interchangeably, namely: a = b e2mod n; B = a e1modern

ECC encryption method

ECC algorithm is also an algorithm that can be used for encryption and digital signature at the same time, and it is also easy to understand and operate. Like RSA algorithm, asymmetric cryptographic algorithm uses one encryption and the other decryption.

Public key algorithms are always based on a mathematical problem. For example, RSA is based on two given prime numbers P and Q, and it is easy to multiply to get N, but it is relatively difficult to factorize N. What's wrong with elliptic curves?

Consider the following equation:

K = kG[ where k and g are points on Ep(a, b), and k is an integer less than n (n is the order of point g)]

It is not difficult to find that given k and g, it is easy to calculate k according to the law of multiplication; But given k and g, it is relatively difficult to find k, which is the difficult problem of elliptic curve encryption algorithm. We call point G as the base point, and k (k

The function of ECC is stronger than RSA. What is interesting is the process of point and point, which is also the source of its function.

Bilateral password

Two-party ciphers use fewer matrices than four-party ciphers. The method of obtaining the encryption matrix is the same as that of the four-party cipher.

The weakness of this encryption method is that if two words are in the same column, the original letters are used, for example, he is encrypted into him. About 20% of the content was exposed.

Quadruple cipher

The tetragonal cipher is encrypted with four 5×5 matrices. Each matrix has 25 letters (usually Q will be cancelled or I and J will be regarded as the same, or a 6×6 matrix will be improved and 10 numbers will be added).

Replacement encryption: an encryption method in which one character replaces another.

Transposition encryption: an encryption method that rearranges the positions of letters in plaintext.

Wheel encryption method: multi-code encryption method, using multiple wheels, each wheel realizes single code encryption. After each letter is encrypted, these rotating wheels can be combined to produce a new replacement pattern.

Multicode encryption:

An encryption method in which one letter in plaintext can be replaced by multiple letters.

Entrainment: A method of hiding messages by hiding their existence.

Triple cipher

First, randomly create a 3×3 Polybius grid replacement password, including 26 English letters and a symbol. Then write the three-dimensional coordinates of the message to be encrypted. The message and coordinates are arranged in four columns, and then the horizontal number and the three numbers are grouped in sequence. Take these three numbers as coordinates, find the corresponding letters and get the ciphertext.

affine cipher

Affine password is an alternative password. It's letter to letter Its encryption function is e(x)=ax+b(mod m), where a and m are coprime. M is the number of letters.

The decoding function is d (x) = a (x-b) (mod m), where a is the multiplicative inverse of a in m group.

Porffy password

hill password

Wei Gena square

The famous Genard square was compiled by cryptographer D Genard, which is generally similar to Caesar's encryption method. That is, two people agree on a key (word), then give the encrypted content to the other party, and the other party will translate the plaintext according to the cipher table. The key is generally a word, which is encrypted in turn according to each letter of the key.

The password encrypted by Genard square brings great difficulty to decipher without the key. D-Genard matrix perfectly avoids the probability algorithm (calculated according to the probability of each letter in each language). For example, the most common word in English is e), which made cryptologists at that time have to find new ways to decipher it.

Etbash code

Etbash code is a system: the last letter represents the first letter, and the penultimate letter represents the second letter.

Fence encryption method

Fence encryption is a relatively simple and fast encryption method. The fence encryption method is to write the files to be encrypted one by one, and then arrange the words in the second line after the first line. The corresponding decoding method is to separate the text from the middle, divide it into two lines and then insert it. The fence encryption method is usually used in combination with other encryption methods.

Pinhole encryption method

This encryption method was born in modern times. Because the postage was very expensive at that time, it cost very little to send newspapers. So people put a hole under the words needed in the newspaper with a needle, and when it is sent to the recipient, the recipient arranges the words with holes in turn to form an article. People seldom use this encryption method.

Pigsty encryption method

/kloc-in the 0/8th century, freemasons invented it so that others could not understand what he wrote. The pigsty password belongs to the replacement password stream, but instead of replacing another letter with a letter, it replaces a letter with a symbol, writes 26 letters into the following four tables, and then replaces them with the part of the table next to this letter when encrypting.

Symmetric encryption algorithm

DES: data encryption standard, which is fast and suitable for encrypting a large number of data (block encryption method);

3DES: Based on DES, a piece of data is encrypted three times with three different keys, with higher strength (block encryption method);

RC2 and RC4: It is faster to encrypt a large amount of data with variable-length keys than DES (stream encryption method);

IDEA international data encryption algorithm, using 128 bit key, provides very strong security (block encryption);

AES: Advanced encryption standard, which is the next generation high-speed and high-security encryption algorithm standard. One implementation of AES standard is Rijndael algorithm (block encryption method);

BLOWFISH uses a variable-length key, which can reach 448 bits in length and runs very fast. After improvement, it is one of the candidates for TWOFISH and AES (Block Encryption).