Skip to content

ClassicPress-research/encryption-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ClassicPress Encryption

ClassicPress EXPERIMENTAL plugin: Post meta fields encryption and decryption for GDPR and privacy laws compliance.
Note: This plugin does not work with the Gutenberg editor.

Instructions

  1. Define CP_PASS_PHRASE constant in wp-config.php file as a passphrase string or Key-Encryption-Key (KEK) API URL.
    Example:
    define('CP_PASS_PHRASE', 'SecretPassPhrase12345'); // Passphrase
    define('CP_PASS_PHRASE', 'http://localhost/api/encryption/encryption.php'); // KEK API URL
  2. Install and activate ClassicPress Encryption plugin.
  3. In the post/CPT administrative area, check the Custom Fields checkbox in the Screen Options section.
  4. The Encrypt and Decrypt buttons will appear at the right-hand side of the Publish or Update buttons. Add the custom field first, then press the encrypt button to encrypt the custom field value.
  5. For existing post meta fields, pressing the Encrypt button will encrypt the post meta fields without the prefix 'encv'. Pressing the Decrypt button will decrypt the encrypted meta values, but will return the same meta value if the prefix 'encv' is not present.
  6. To manually encrypt or decrypt data, such as when storing or displaying custom fields, use the BasicPHP methods encrypt and decrypt.
    Example:
    Basic::encrypt($plaintext, CP_PASS_PHRASE); // Encrypt data
    Basic::decrypt($encrypted, CP_PASS_PHRASE); // Decrypt data

Features

  1. Advanced Encryption Standard (AES) - GCM, or CTR/CBC Mode with 256-bit key
  2. Passphrase or Key-Encryption-Key (KEK) API URL for decoupling encryption keys
  3. Keyed-Hash Message Authentication Code (HMAC) for authentication - SHA256
  4. Password-Based Key Derivation using a secret passphrase - SHA256 with 10,000 iterations
  5. Encryption versioning for backward compatibility - 'enc' prefix, concatenated with 'v1' for versioning

About

ClassicPress EXPERIMENTAL plugin: Functions for developers to use to encrypt data at-rest.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages