rsa public key and private key is used to encrypt which in the end, which is used to decrypt?

This switched: 91 blog ; Original Address: http://www.9191boke.com/138589019.html

Public and private keys in some banking systems, third-party payment system SDK often encounter, new to public and private key friends expected to be difficult to distinguish the difference.

What RSA public and private keys are?

First of all, the RSA is an asymmetric encryption algorithm, which is a three mathematicians (Rivest, Shamir, Adleman) is designed. Asymmetric encryption is a symmetric encryption relative terms. Refers to a symmetric encryption algorithm using the encryption and decryption are the same secret key, encryption and asymmetric encryption and decryption is performed by the two keys (public key, private key), and shows asymmetric encryption more secure.

The name suggests is a public key public key will be issued to holders of multiple, while the private key is private password is often only a holder.

Public and private key characteristics

  • Public and private keys are paired;

  • Private key file contains a public key, the private key can be exported based on public key;

  • The longer the key, the more difficult to break, so the 2048-bit key to be more secure than 1024 keys;

  • Public and private keys are the keys, the public is that the public key, the public is not private.

Public and private keys are available for encrypting and decrypting

Public and private keys can be used for encryption and decryption operations, data encrypted with the public key can only be decrypted by the corresponding private key, and vice versa. Although both can be used for encryption, but different scenarios using a different key to encrypt the following rules:

1, the private key used for signing, public key is used to sign test

The role of different signatures and encryption, signature not for secrecy, but to ensure that this signature is signed by someone specific, rather than being forged signatures of other people, so the private key on privacy suitable for use in your signature.

After the signature private key can only be decrypted by the corresponding public key, the public key is public (many people can hold), so these people holding a public key to decrypt, decryption is successful will be able to determine the private key is held people to do signature verification of identity, legitimacy.

2, the public key is used to encrypt, decrypt the private key is used, it can play the role of encryption

Because the public key is published, many people can hold public key. If using a private key encryption, that all those who hold public key can be decrypted, it is not safe!

If using public key encryption security, it can only be decrypted by the private key, the private key is private and not public, the private key can be decrypted only by a specific holder, guaranteed data.

Guess you like

Origin www.cnblogs.com/007sx/p/10987906.html