aboutsummaryrefslogtreecommitdiff
path: root/lua/encrypt/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/encrypt/helpers.lua')
-rw-r--r--lua/encrypt/helpers.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/encrypt/helpers.lua b/lua/encrypt/helpers.lua
new file mode 100644
index 0000000..37a96b3
--- /dev/null
+++ b/lua/encrypt/helpers.lua
@@ -0,0 +1,13 @@
+---@return string
+local function getPassword()
+ local password = vim.b["password"]
+ if password == nil then
+ password = vim.fn.inputsecret("Enter password: ")
+ vim.b["password"] = password
+ end
+ return password
+end
+
+local ENCRYPTED_PREFIX = "# <<<encrypted>>>"
+
+return { getPassword = getPassword, ENCRYPTED_PREFIX = ENCRYPTED_PREFIX }