One, the introduction
Recently, we have been doing project docking for a long time. Almost every company that has docking has its own set of parameter encryption and decryption methods. I write this article to record different encryption and decryption methods for future use. Without elaboration on the principle, this article gives an overview of various common algorithms, as well as their advantages and disadvantages, and application scenarios.
Second, algorithm overview
According to the legend, encryption is generally classified into Hash digest, symmetric encryption, and asymmetric encryption. If a Hash digest is not a form of encryption in the strict sense. One might wonder if Base64 is an encryption algorithm? Of course, it’s not an encryption algorithm, it’s just a way of encoding data, which is reversible, but it’s public, it’s not encryption at all.
Hash digest
In fact, it’s either encryption or Hash, and since it’s digest information, the conversion process is irreversible. Common Hash digest algorithms include MD5 and SHA (SHA-1 and SHA-2).
Four, symmetric encryption
The same key can be used for encryption and decryption, which is efficient. Ciphertext and original text can be exchanged with each other through keys. Common symmetric encryption algorithms include DES and AES. There are also standards that are not widely used, including Blowfish, IDEA, RC5, RC6, and so on.
4.1 the DES
DES is the first widely used symmetric encryption algorithm standard, and in the beginning of 2000, it evolved a higher strength 3DES encryption standard.
4.2 the AES
AES advanced Encryption Standard is the next generation of encryption algorithm standard, high speed, high security level, is increasingly becoming the actual standard for encrypting various forms of electronic data. This standard is recommended for symmetric encryption.
Five, asymmetric encryption
For encryption and decryption, use the public key and private key of the key pair respectively. Generally, the public key (with a short public key) is encrypted, and the private key is decrypted, or vice versa. The same key can only complete one process of encryption and decryption, but cannot be both encrypted and decrypted. Encryption strength is superior to Hash digest and symmetric encryption.
Six, summarized
This article read some daniu’s blogs in the process of sorting out, heartfelt thanks, especially to programmer Xiao Grey, Mi pu’s blog again express thanks. This paper briefly introduces various encryption algorithms, mainly for the system record, to prevent forgetting. There will also be an article on how to implement the code.