[Encryption code collection] Python implements encryption of three elements

Usually we often need to transmit data, and the transmission of some sensitive information needs to be encrypted to prevent data leakage. For example, the transmission of name, mobile phone number, ID number (referred to as the three elements), etc. Now we want to test the three-party data. We need to provide the three elements to the other party, and the other party will feedback the corresponding labels to us. At this time, the three elements need to be encrypted, and different third-party organizations have different requirements for encryption methods, and data must be provided according to the organization's requirements.
  
This article sorts out the common encryption methods for third-party data testing. No matter which one the organization needs, it can be quickly implemented.


  

1. Common encryption methods in Python

  
Common encryption methods in Python include the following:
  

  1. Hash encryption: such as MD5, SHA1, SHA256, etc. This encryption method converts raw data (usually a string) into a fixed-length hash value. This is a one-way process, i.e. once the data has been hashed, it cannot be "decrypted" back to the original data.
      
  2. Symmetric encryption: such as AES, DES, etc. This encryption method uses the same key for encryption and decryption.
      

Guess you like

Origin blog.csdn.net/qq_32532663/article/details/133248637
Recommended