diff options
| author | kongjun <kongjun18@outlook.com> | 2025-05-06 10:10:59 +0000 |
|---|---|---|
| committer | kongjun <kongjun18@outlook.com> | 2025-05-06 10:10:59 +0000 |
| commit | c7a16c626a0379d9304e0337348affb4bde9ba4e (patch) | |
| tree | 43e4ba24f0db713d720dfacd20565d7e7687cd3c | |
| parent | 872632670c31f682f3db01707468dbc12f154ab4 (diff) | |
| download | encrypt.nvim-c7a16c626a0379d9304e0337348affb4bde9ba4e.tar.gz | |
feat: support password with special characters
| -rw-r--r-- | lua/encrypt/decrypt.lua | 2 | ||||
| -rw-r--r-- | lua/encrypt/encrypt.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lua/encrypt/decrypt.lua b/lua/encrypt/decrypt.lua index 72e93c3..de49019 100644 --- a/lua/encrypt/decrypt.lua +++ b/lua/encrypt/decrypt.lua @@ -5,7 +5,7 @@ local helpers = require("encrypt.helpers") ---@param password string local function decrypt_lines(lines, password) return vim.fn.systemlist( - "base64 --decode | openssl enc -d -aes-256-cbc -pbkdf2 -salt -in - -out - -k " .. password, + "base64 --decode | openssl enc -d -aes-256-cbc -pbkdf2 -salt -in - -out - -k " .. vim.fn.shellescape(password), lines ) end diff --git a/lua/encrypt/encrypt.lua b/lua/encrypt/encrypt.lua index 5cdf8a9..93d2b78 100644 --- a/lua/encrypt/encrypt.lua +++ b/lua/encrypt/encrypt.lua @@ -5,7 +5,7 @@ local helpers = require("encrypt.helpers") ---@param password string local function encrypt_lines(lines, password) return vim.fn.systemlist( - "openssl enc -aes-256-cbc -pbkdf2 -salt -in - -out - -k " .. password .. " | base64", + "openssl enc -aes-256-cbc -pbkdf2 -salt -in - -out - -k " .. vim.fn.shellescape(password) .. " | base64", lines ) end |
