Recently, in the process of contact with Hadoop, the public key and the private key is not clear, write a blog to learn.
Encryption and authentication
encryption is the encryption of data, so that illegal users, even if the encrypted data can not obtain the correct information content, so data encryption to protect data, prevent monitoring attacks. The focus is on the security of the data.
Identity Authentication is used to determine the authenticity of an identity, after confirming the identity, the system can be based on different identities to give different permissions. Its focus is on the authenticity of the user. The focus of the two is different.
Public and private keys
The public and private keys are commonly known as asymmetric encryption, which is improved from the previous symmetric encryption (using user name and password).
The public key is for others.
The private key is for your own use.
Interaction: The function of public key and private key is: the content encrypted with public key can only be decrypted with the private key, and the content encrypted with the private key can only be decrypted with the public key.
Instance:
For example, I want to send you an encrypted message. First, I have to have your public key, and you have to have my public key.
first of all, I use your public key to encrypt this message, so that the message is not seen by others, and ensure that the message is not modified during the transfer, to ensure that the message is sent by me. After you receive the email, you can decrypt it with your private key and you can see the content.
second, I use my private key to encrypt this message, sent to your hand, you can use my public key decryption. Because the private key is only in my hand, this ensures that this email is sent to me.
when a->b data, a will use B's public key encryption, so as to ensure that only B can unlock, otherwise the general public can unlock the encrypted message, is to the confidentiality of information.
Cryptography Literacy: Encryption, authentication, public key, private key