From f3e3bd78ef0ea9c58f3f753d089d6266fdb954b5 Mon Sep 17 00:00:00 2001 From: ray-ang <46805160+ray-ang@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:35:10 -0400 Subject: [PATCH] Encryption and decryption buttons --- README.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6262f45..dc4f2e9 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ -## ClassicPress Encryption -ClassicPress EXPERIMENTAL plugin: Encryption functions to encrypt and decrypt data for GDPR and privacy laws compliance. +### ClassicPress Encryption +ClassicPress EXPERIMENTAL plugin: Post meta fields encryption and decryption for GDPR and privacy laws compliance. -### Instructions -1. Define CP_PASS_PHRASE constant in wp-config.php file.
+## Instructions +1. Define CP_PASS_PHRASE constant in wp-config.php file.
Example:
define('CP_PASS_PHRASE', 'SecretPassPhrase12345');
-2. Use cp_encrypt( ) function to encrypt data.
-Example:
-$name = 'plaintext';
-add_metadata( 'post', $pid, 'name', cp_encrypt( $name ) );
-3. Use cp_decrypt( ) function to decrypt data.
-Example:
-$encrypted_name = 'enc-v1::RVNIWlBpL2VueDAzNUFzdnJ2ZzhaQT09::MDk1Y2NkZWMzYTVjMDlmNjg3ZTk4YWE1MDk5MzI2NzNlN2FmODczZWYzYzNjOTRkYjZkNzk5MDkwM2YxYTI5MQ==::5oJ5xSt66wy2i7qI73OXsg==::3C8e5/PyEGhYDk+vgn0U7w==::kYScP8LQvpc5VBnyPTVJ8g==';
-echo cp_decrypt( $encrypted_name );
+2. Install and activate ClassicPress Encryption plugin.
+3. Check the Custom Fields checkbox in the Screen Options section.
+4. In the post/CPT administrative area, 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. Pressing the Decrypt button will decrypt encrypted meta values, but will return the same meta value if the prefix 'encv' is not present. -### Features -1. Advanced Encryption Standard (AES) - CBC Mode with 256-bit key -2. Keyed-Hash Message Authentication Code (HMAC) for authentication -3. Password-Based Key Derivation using a secret passphrase -4. Encryption versioning for backward compatibility +## Features +1. Advanced Encryption Standard (AES) - GCM, or CTR/CBC Mode with 256-bit key +2. Keyed-Hash Message Authentication Code (HMAC) for authentication - SHA256 +3. Password-Based Key Derivation using a secret passphrase - SHA256 with 10,000 iterations +4. Encryption versioning for backward compatibility - 'enc' prefix, concatenated with 'v1' for versioning