{"id":31581363,"url":"https://github.com/pivaldi/emacs-passfile","last_synced_at":"2025-10-05T21:56:40.804Z","repository":{"id":311672915,"uuid":"1044539337","full_name":"pivaldi/emacs-passfile","owner":"pivaldi","description":"Very simple Emacs package allowing to view and edit securely a GnuPG encrypted file","archived":false,"fork":false,"pushed_at":"2025-08-25T21:12:46.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-25T23:21:03.719Z","etag":null,"topics":["emacs","password-store","passwords","security"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pivaldi.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-25T20:54:59.000Z","updated_at":"2025-08-25T21:19:08.000Z","dependencies_parsed_at":"2025-08-25T23:21:14.421Z","dependency_job_id":null,"html_url":"https://github.com/pivaldi/emacs-passfile","commit_stats":null,"previous_names":["pivaldi/emacs-passfile"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pivaldi/emacs-passfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivaldi%2Femacs-passfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivaldi%2Femacs-passfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivaldi%2Femacs-passfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivaldi%2Femacs-passfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pivaldi","download_url":"https://codeload.github.com/pivaldi/emacs-passfile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pivaldi%2Femacs-passfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278526241,"owners_count":26001326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","password-store","passwords","security"],"created_at":"2025-10-05T21:56:38.974Z","updated_at":"2025-10-05T21:56:40.798Z","avatar_url":"https://github.com/pivaldi.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+title: Emacs PassFile\n\nThis simple Emacs package allows you to securely view and edit a GnuPG-encrypted file.\n\n* Why This Package?\n\nConsider the decrypted file [[secret.txt]] and its encrypted counterpart ~secret.gpg~.\\\\\nWhile you could open the ~.gpg~ file in Emacs, especially if you have many\npackages installed, this comes with the risk that malicious code embedded in\nthose packages (automatically downloaded and installed) could access your\nsecrets.\n\nTo prevent this, the goal of this package is to open your secret file in a\n*minimalist Emacs configuration* that *hides sensitive text and provides\nfunctions to generate strong passwords*.\n\nYour secret file does not need to follow any specific structure, write whatever you want, however you like.\n\n** Without ~emacs-passfile~\n#+html: \u003cp align=\"center\"\u003e\u003cimg src=\"secret-txt.png\" /\u003e\u003c/p\u003e\n** With ~emacs-passfile~\n#+html: \u003cp align=\"center\"\u003e\u003cimg src=\"secret.png\" /\u003e\u003c/p\u003e\n\n* Getting Started\n\n#+BEGIN_SRC bash\ncd WHERE_YOU_WANT\ngit clone https://github.com/pivaldi/emacs-passfile\nemacs --init-directory=WHERE_YOU_WANT/emacs-passfile/ WHERE_YOU_WANT/emacs-passfile/secret.gpg\n#+END_SRC\n\nThe password is ~plop~.\n\nPersonally, I created a script to open my favorite encrypted file:\n#+BEGIN_SRC bash\n#!/usr/bin/env bash\n\nemacs --init-directory=\"$HOME/src/emacs-passfile/\" \"$HOME/secret.gpg\"\n#+END_SRC\n\n* Hiding Content\n** Hiding Passwords\n- ~pwd: xxxxxxxxxx~ : hides the ~xxxxxxxxxx~, stopping at the next space. Useful for one-line content.\n- ~password: xxxxx xxxxx~ : hides the entire ~xxxxx xxxxx~ string, regardless of spaces. Cannot be mixed with other content on the same line.\n\n** Hiding Usernames\n- ~user: xxxxxxxxxx~ : hides the ~xxxxxxxxxx~, stopping at the next space. Useful for one-line content.\n- ~username: xxxxx xxxxx~ : hides the full ~xxxxx xxxxx~ string, regardless of spaces. Cannot be mixed with other content on the same line.\n- ~[xxxxxxxxxx]~ : hides the ~xxxxxxxxxx~. Only one bracketed block can be used per line due to overlap.\n\n** Hiding Paragraphs\nA whole paragraph can be hidden using the block delimiters ~#+hidden~ and ~#-hidden~ as shown:\n#+BEGIN_SRC\n#+hidden\n…content…\n#-hidden\n#+END_SRC\n\n* Password Generation\n\nThis package uses [[https://github.com/vandrlexay/emacs-password-genarator][password-generator]] to provide useful functions for creating passwords:\n- ~epf-password-generate~: generates a strong password for security-focused users.\n- ~password-generator-simple~: generates a simple password sufficient for most websites (not highly secure, but usually enough to register).\n- ~password-generator-strong~: generates the strongest possible password, omitting certain symbols (like $, \\, etc.) to avoid shell escaping issues.\n- ~password-generator-numeric~: generates numeric-only passwords, such as credit card PIN codes.\n- ~password-generator-phonetic~: generates passwords that are easy to remember because of their phonetic structure, though they are less secure.\n\n* Dependencies\n\nThis package has two dependencies:\n- [[https://github.com/vandrlexay/emacs-password-genarator][password-generator]]: provides simple functions to create passwords and insert them directly into the buffer.\\\\\n  ~emacs-passfile~ provides the function ~epf-password-generate~, which wraps ~password-generator-paranoid~.\n- [[https://github.com/jekor/hidepw][hidepw]]: a minor mode for hiding passwords. This is useful if you view your passwords in Emacs and want to prevent shoulder surfing.\n\n* Customization \u0026 Configuration\n** hidepw\n- ~emacs-passfile~ uses the following configuration:\n  #+BEGIN_SRC emacs-lisp\n    (setq hidepw-patterns\n          '(\"#\\\\+hidden\\n\\\\([^\r]*?\\\\)\\n#-hidden$\"\n            \" \\\\[\\\\(.+\\\\)\\\\] ?\"\n            \"^\\\\[\\\\(.+\\\\)\\\\] ?\"\n            \"[pP]wd[  ]?: \\\\([^ \\n]+\\\\)\"\n            \"[pP]assword[  ]?: \\\\(.+\\\\)$\"\n            \"[uU]ser[  ]?: \\\\([^ \\n]+\\\\)\"\n            \"[uU]sername[  ]?: \\\\(.+\\\\)\"))\n  #+END_SRC\n- You can customize the variable ~hidepw-patterns~ from the [[https://github.com/jekor/hidepw][hidepw]] package using the ~customize-variable~ command.\n- See ~M-x customize-group [RET]hidepw[RET]~ for further customization.\n\n** Emacs configuration\nFor convenience, you can add your own Emacs configuration in the personal file\n~configure.el~. However, it is not recommended to install external packages in this setup.\n\nHere is my personal configuration:\n\n#+BEGIN_SRC emacs-lisp\n;;; configure.el --- My personal configuration -*- lexical-binding: t; -*-\n;;\n;;; Commentary:\n;;; Code:\n\n(delete-selection-mode 1)\n(show-paren-mode 1)\n\n(require 'skeleton)\n(setq skeleton-pair t)\n\n;;;###autoload\n(defun epf-kill-window-and-buffer()\n  \"Delete current window and buffer.\"\n  (interactive)\n  (kill-current-buffer)\n  (condition-case nil (delete-window) (error nil)))\n(global-set-key [f12] #'epf-kill-window-and-buffer)\n\n;;;###autoload\n(defun epf-new-login()\n  \"Insert a new login entry: Username:… Pwd:….\"\n  (interactive)\n  (let ((user (read-from-minibuffer \"Username: \")))\n    (insert (format \"Username: %s\\nPwd: %s\\n\" user (epf-password-generate nil t)))))\n\n;;;###autoload\n(defun epf-scroll-up()\n  \"Scroll up keeping the cursor on the same line.\"\n  (interactive)\n  (let ((scroll-preserve-screen-position t))\n    (scroll-up 1)))\n\n;;;###autoload\n(defun epf-scroll-down()\n  \"Scroll down keeping the cursor on the same line.\"\n  (interactive)\n  (let ((scroll-preserve-screen-position t))\n    (scroll-down 1)))\n\n(global-set-key (kbd \"C-c p\") #'epf-password-generate)\n(global-set-key (kbd \"C-M-\u003cprior\u003e\") #'move-beginning-of-line)\n(global-set-key (kbd \"C-M-\u003cnext\u003e\") #'move-end-of-line)\n(global-set-key (kbd \"C-\u003cprior\u003e\") (lambda nil (interactive) (other-window -1 nil)))\n(global-set-key (kbd \"C-\u003cnext\u003e\") (lambda nil (interactive) (other-window 1 nil)))\n(global-set-key (kbd \"C-c l\") #'epf-new-login)\n(global-set-key (kbd \"C-M-\u003cdown\u003e\") #'epf-scroll-down)\n(global-set-key (kbd \"C-M-\u003cup\u003e\") #'epf-scroll-up)\n(global-set-key (kbd \"C-:\") 'undo-redo)\n(global-set-key \"\\{\" 'skeleton-pair-insert-maybe)\n(global-set-key \"\\(\" 'skeleton-pair-insert-maybe)\n(global-set-key \"[\" 'skeleton-pair-insert-maybe)\n(global-set-key \"\\\"\" 'skeleton-pair-insert-maybe)\n(global-set-key \"'\" 'skeleton-pair-insert-maybe)\n\n(provide 'configure)\n;;; configure.el ends here\n#+END_SRC\n\n* License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n* Acknowledgments\n\n- Inspired by the need for simple, secure, and minimal password management within Emacs.\n- Thanks to the authors of [[https://github.com/vandrlexay/emacs-password-genarator][password-generator]] and [[https://github.com/jekor/hidepw][hidepw]] for their useful libraries.\n\nFor more information, bug reports, or contributions, please visit the [[https://github.com/pivaldi/emacs-passfile][GitHub repository]].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpivaldi%2Femacs-passfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpivaldi%2Femacs-passfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpivaldi%2Femacs-passfile/lists"}