[WordPress] 外掛分享: Fernet Encryption

首頁外掛目錄 › Fernet Encryption
WordPress 外掛 Fernet Encryption 的封面圖片
10+
安裝啟用
尚無評分
463 天前
最後更新
問題解決
WordPress 6.4+ PHP 8.0+ v1.1.0 上架:2021-09-01

內容簡介

Fernet Encryption 是一個 WordPress 外掛,可使用 Fernet 加密和解密資料。

設定您的金鑰

要設定您的金鑰,您需要在 wp-config 檔案中加入以下行。

define( 'FERNET_KEY', 'YOUR_FERNET_KEY' );

如果您選擇不設定您的金鑰,您需要保存啟用該外掛時提供的金鑰副本。

重要提示:更改 WordPress salts 將使預設提供的 Fernet 金鑰無效。

如何使用

要加密資料,只需在您的程式碼中使用$token = fernet_encrypt( 'YOUR MESSAGE' )。

要解密資料,只需在您的程式碼中使用fernet_decrypt( $token )。

您可以使用以下簡碼進行加密:

[fernet-encrypt]YOUR MESSAGE[/fernet-encrypt]

您可以使用以下簡碼進行解密:

[fernet-decrypt]YOUR-FERNET-TOKEN[/fernet-decrypt]

我們也添加了一些有用的輔助函數:

fernet_get_post_meta
fernet_add_post_meta
fernet_update_post_meta
fernet_get_user_meta
fernet_add_user_meta
fernet_update_user_meta
fernet_add_option
fernet_get_option
fernet_update_option

感謝

插圖由 undraw.co 提供
Fernet PHP 修改自 Kelvin Mo 的 Fernet-PHP

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Fernet Encryption」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Fernet Encryption is a plugin that can be used to encrypt and decrypt data in WordPress using fernet.
Development was originally sponsered by Access Networks.
Setup your Key
To setup your key, you need to add the following line to your wp-config file.
`

define( ‘FERNET_KEY’, ‘YOUR_FERNET_KEY’ );
`
If you choose not to setup your key, you will need to save a copy of the one provided upon activation of the plugin.
IMPORTANT: Changing your WordPress salts will invalidate the default Fernet key provided.
How to Use
To encrypt data simply use $token = fernet_encrypt( 'YOUR MESSAGE' ) in your code.
To decrypt the data simply use fernet_decrypt( $token ) in your code.
You can use the following shortcode to encrypt:
[fernet-encrypt]YOUR MESSAGE[/fernet-encrypt]

You can use the following shortcode to decrypt:
[fernet-decrypt]YOUR-FERNET-TOKEN[/fernet-decrypt]

We have also added useful helper functions:

fernet_get_post_meta
fernet_add_post_meta
fernet_update_post_meta
fernet_get_user_meta
fernet_add_user_meta
fernet_update_user_meta
fernet_add_option
fernet_get_option
fernet_update_option

Credit

Illustrations provided by undraw.co
Fernent PHP modified from Kelvin Mo – Fernet-PHP

延伸相關外掛

文章
Filter
Apply Filters
Mastodon