Command line tools for Windows 10 to manage passwords stored in AES encrypted files.
Files with passwords can store any additional information: comments, empty lines, logins. Only following rules must be observed:
- The line is divided into chunks using spaces
- First chunk is tag that describes password
- Second chunk is the password (so, it can't contain spaces)
- Other chunks can be used as you wish
Example passwords.txt
:
# Social Networks passwords file.
## Google
google.me PASSWORD [email protected] // No comments
google.mom PASSWORD // Mom's password
google.dad PASSWORD [email protected]
## Facebook
....
This file should be encrypted using openssl
as passwords.aes
with some secret password
openssl aes-256-cbc -salt -in passwords.txt -out passwords.aes
enter aes-256-cbc decryption password:
Note: You can also make the file base64-encoded by adding
-a
switch to the command above, to be able copy and paste its text content.
Strongly recommended to check encrypted file before next steps.
openssl aes-256-cbc -d -in passwords.aes
After it passwords.txt
can be removed.
- Create file with passwords as described in Storage section and encrypt it
- Download copypass.bat and findpass.bat
- Run following command, and enter secret password to output all tags, matching
google
substring:
C:\Users\user>findpass.bat passwords.aes google
google.me
google.mom
google.dad
- Copy password by tag to system clipboard:
C:\Users\user>copypass.bat passwords.aes google.me
- Paste it in form submit form and copy something else to reset clipboard value.
Note: this format can be used in Unix-based systems with aliases:
echo "alias findpass='function __findpass() { read -sp \"Enter password: \" PASS;echo;export PASS;openssl aes-256-cbc -d -in \$1 -pass env:PASS|grep \$2|awk \"{print \\\$1}\";unset PASS;unset -f __findpass; }; __findpass'" >> ~/.bashrc
echo "alias copypass='function __copypass() { read -sp \"Enter password: \" PASS;echo;export PASS;openssl aes-256-cbc -d -in \$1 -pass env:PASS|grep \$2|head -1|awk \"{print \\\$2}\"|xclip --clipboard;unset PASS;unset -f __copypass; }; __copypass'" >> ~/.bashrc
Edit encrypted files using OpenSSL plugin for VIM.
Note: If your encrypted file is base64-encoded (
openssl -a
switch) you have to apply this patch to be able to edit the file using VIM:
$ sed -i -r -e 's/-([ed]) -salt/-\1 -a -salt/g' ~/.vim/plugged/openssl.vim/plugin/openssl.vim
OpenSSL 1.0.1f 6 Jan 2014 Windows 10 Pro Version 10.0.15063 Linux Subsystem Ubuntu 14.04.5 LTS OpenSSL VIM plugin version 3.2