SymmetricAlgorithmUsed in combination with asymmetric algorithms, such:
The sender has a public key and the receiver has a private key.
1. Sender:
First, the sender generates a random symmetric key, encrypts the data with the symmetric key, and puts it in a digital envelope. Then, the sender uses the public key to package the random symmetric key, put it in a digital envelope, and finally transmits the digital envelope to the receiver.
2 "receiving end:
After receiving the data, divide the number envelope into two parts: the password package and the encrypted data. Then, use your private key to decrypt the "password package" and retrieve the symmetric password, use a symmetric key to restore the encrypted data.
If the data to be transmitted is too long, the data encrypted with symmetric keys is faster than that of asymmetric keys, and then packaged with symmetric keys.