The pgcrypto extension provides a cryptographic functionality. Data encryption and decryption consume hardware resources, so it is important to have a balance between data sensitivity and decryption complexity. There are two kinds of data encryption:
- One-way data encryption uses a function to generate a hash, which cannot be reversed. The resulting encrypted text often has a fixed length; for example, MD5 encryption generates 16 bytes of hashes. A good hash function should be quick to compute and not produce the same hash for a different input.
- Two-way data encryption allows the data to be encrypted and decrypted. pgcrypto comes with functions to support one-way and two-way encryption. It supports several hashing algorithms. pgcrypto ...