Current location - Quotes Website - Personality signature - The difference between RSA encryption and signature
The difference between RSA encryption and signature
RSA encryption: RSA cryptosystem is a public key cryptosystem. The encryption algorithm is public, and the assigned keys are encryption and decryption keys. Generally speaking, in a pair of public keys and private keys, both can be used for encryption and decryption, that is, public key encryption can and can only be decrypted by the corresponding private key, and private key encryption can and can only be decrypted by the corresponding public key. But we usually use public key encryption and private key decryption, and the generated private key often contains more information than the public key. (The encryption mentioned here must be reversible, otherwise it can be directly destroyed. No more encryption is needed. Encryption is to ensure the security of data and verify identity. )

RSA Signature: Signing is to add a powerful proof at the back of this information to prove the publisher of this information and the validity and integrity of this information. RSA signature is often used to hash this information to get a hash value, and then encrypt the hash value into a signature with a suffix at the end of the information. After receiving the transmitted data, the receiver decrypts the encrypted hash with the private key to obtain a hash value, and then hashes the original information to compare whether the two hashes are consistent (verification). The process of signing is irreversible because the hash is irreversible. After all, if such a large file can be hashed into a string and can be recovered, it is a bunker.

When using RSA communication, it is generally a combination of the two, namely: encryption >; Sign > decrypt > check and sign.

We can encrypt the document with the public key and decrypt it with the private key, but our signature on this document is irreversible because the hash itself is irreversible.

The former uses encryption to protect the content from being leaked, while the latter uses encryption for authentication.

This is because the middleman is prevented from trying to repeatedly send some specific characters to the owner of the private key to obtain encrypted information, so as to achieve the purpose of cracking or forging. So it is not safe to encrypt information with private key casually.

Because RSA signature and encryption need to generate more workload than usual communication, it is generally only used where data security is needed (but it will be extended to many aspects with the improvement of equipment performance. After all, it is important to keep privacy, although some people don't care. The encryption and decryption of HTTPS can refer to /p/ 1b48c37b94b9.