1. Basic Concepts
1. Password
We are more familiar with the login e-mail, website and so on need to use password login, this password is actually a password, is used to authenticate the identity of the user, cryptography on the "password" is defined in accordance with a certain rule, the communication between the two sides of the information to the translation of the symbol.
2. Clear Text
Is the message that the sender wants to send.
3. Ciphertext
Is the information that the original message has been encrypted.
4. Encryption
Refers to the process of turning clear text into ciphertext. Encryption uses cryptographic algorithms.
5. Decryption
Is the process of turning ciphertext into plaintext. Decryption uses the decryption algorithm.
6. Key
A key is an argument that is entered in an algorithm that converts plaintext into ciphertext or converts ciphertext to clear text. The key is divided into symmetric key and asymmetric key. 2. Common encryption Algorithms
1. Symmetric encryption Algorithm
The encrypted key is the same as the decrypted key
symmetric encryption algorithms are:
AES, DES, 3DES (3DESede or TripleDES), BLOWFISH,RC4
2. Asymmetric Encryption Algorithm
The encrypted key differs from the decrypted key
Asymmetric encryption algorithms are:
Rsa,dsa,ecc
3. One-way hashing algorithm
One-way hash:
The one-way hash function h (m) acts on an arbitrary length message M, which returns a fixed-length hash value h, which is irreversible and does not have a "collision".
one-way hashing algorithms (message digest algorithms) are:
MD5
SHA-1
4. The choice of digital Signature Algorithm
selection of Algorithms
Since the speed of asymmetric encryption algorithm is much slower than that of symmetric encryption, when we need to encrypt a large amount of data, we recommend symmetric encryption algorithm to improve the speed of encryption and decryption.
Symmetric encryption algorithms cannot implement signatures, so signatures can only be asymmetric.
Because the key management of symmetric encryption algorithm is a complicated process, the key management directly determines his security, so when the amount of data is very small, we can consider using asymmetric encryption algorithm.
In the actual course of operation, we usually adopt the way is: using asymmetric encryption algorithm to manage the key of the symmetric algorithm, and then encrypt the data with the symmetric encryption algorithm, so that we have integrated the advantages of two kinds of encryption algorithms, not only to achieve the advantages of fast encryption, but also to achieve a safe and convenient management key advantages.
So how many bits of the key? RSA recommends the use of 1024 digits, ECC recommended 160 bits, AES 128 for it.
PS: The difference between digital signature and encryption
The role of digital signature is to ensure the integrity of the data, the second is the identity of the sender authentication. Therefore, it uses the asymmetric algorithm, the message sender uses the private key to encrypt, the receiver uses the public key decryption verification to sign;
Encryption focuses on "data security" to prevent data from being monitored for attacks. So the message sender uses public key encryption, only the receiver with the private key can decrypt;