Symmetric encryption algorithm
Symmetric encryption algorithm is an early application of encryption algorithm, the technology is mature. In the symmetric encryption algorithm, the sender of the data sends the plaintext (raw data) and the encryption key together by a special encryption algorithm, which makes it into a complex cipher cipher. After receiving the ciphertext, if you want to interpret the original text, it is necessary to decrypt the ciphertext by using the encryption key and the inverse algorithm of the same algorithm, so that it can be restored to readable plaintext. In the symmetric encryption algorithm, only one key is used, both parties use the key to encrypt and decrypt the data. It requires the sender and receiver to agree on a key before communicating securely. The security of a symmetric algorithm relies on the key, which means that anyone can decrypt the message they send or receive, so the confidentiality of the key is critical to the security of the communication.
The symmetric encryption algorithm is characterized by its openness, low computational capacity, fast encryption speed and high encryption efficiency. The disadvantage is that both sides of the transaction use the same key, the security is not guaranteed. Furthermore, each time a user uses a symmetric encryption algorithm, they need to use a unique key that other people do not know, which makes the number of keys owned by both the sender and the recipient grow exponentially, and the key management becomes a burden to the user. Symmetric encryption algorithm is difficult to use in distributed network system, mainly because of difficulty in key management and high cost of use.
Asymmetric encryption algorithm
The asymmetric encryption algorithm uses two pairs of keys that are completely different but perfectly matched: the public key (the encryption key) and the private key (the decryption key).
When encrypting a file using an asymmetric encryption algorithm, the process of encrypting and decrypting the plaintext is accomplished only by using a matching pair of public and private keys. When encrypting plaintext, the public key is encrypted, the private key is used to decrypt the text, and the originator (the dongle) knows the public key of the receiving party, and only the recipient (the decryption) is the only one who knows its private key. The basic principle of asymmetric encryption algorithm is that if the originator wants to send encrypted information that only the receiving party can read, the originator must first know the recipient's public key and then use the public key of the receiving party to encrypt the original text; After the recipient receives the encryption, it uses its own private key to decrypt the text. Obviously, the use of asymmetric encryption algorithm, the two sides of the transceiver before the communication, the receiver must have their own randomly generated public key sent to the originator, and retain the private key. Because the asymmetric algorithm has two keys, it is particularly suitable for data encryption in distributed systems. The widely used asymmetric encryption algorithm has the RSA algorithm and the United States National Standards Bureau proposed DSA.
One-way hash function (hash) encryption algorithm
The hash function has an input and an output, where the input is called a message, and the output is called a hash value (hash code). A one-way hash function calculates the hash value based on the content of the message, and the hash value can be used to check the integrity of the message. The length of the hash value is independent of the length of the message. Whether the message is 1-bit, 100MB, or even 100GB, the one-way hash function calculates a fixed-length hash value. Taking the SHA-256 one-way hash function as an example, the hash value it calculates is always 256 bits (32 bytes) in length. To be able to confirm integrity, even a change of 1 bits in the message can result in a different hash value. The hash value of the one-way hash function output is also known as Message Digest (MSG Digest) or fingerprint (fingerprint)
MD4, MD5 is such a cryptographic algorithm
MD (Messge Digest) 4 is a one-way hash function designed by Rivest in 1990, capable of generating 128-bit hash values. Now it's not safe anymore. MD (Messge Digest) 5 is a one-way hash function designed by Rivest in 1991, capable of generating 128-bit hash values. The strong anti-collision of MD5 has been compromised. That is, it is now possible to produce two different messages with the same hash value, so it is also unsafe.
See reference for more relevant knowledge
Reference
Cipher algorithm Secret, a article let you become an international security algorithm and national secret algorithm expert
Some common sense about the addition and decryption