From: Sergey Matveev Date: Mon, 2 Jun 2025 09:15:47 +0000 (+0300) Subject: Lower case keys X-Git-Url: http://www.git.stargrave.org/?p=passman.git;a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=07ed1155bcf2ea6c5cd0cb75f774e2b5cd3cccd7 Lower case keys --- diff --git a/README b/README index 356fd49..a65bf07 100644 --- a/README +++ b/README @@ -1,8 +1,11 @@ passman -- simple password manager -It stores passwords in single recfile -(https://www.gnu.org/software/recutils/), that is by default encrypted -by age (https://github.com/FiloSottile/age) with the passphrase and -compressed by zstd. +It stores passwords in single recfile, that is encrypted either by age +or cmenctool with the passphrase, and compressed by Zstandard. + +=> https://www.gnu.org/software/recutils/ recfile/recutils +=> https://github.com/FiloSottile/age age +=> http://www.keks.cypherpunks.su/cm/index.html cmenctool +=> https://facebook.github.io/zstd/ Zstandard * passman add NAME [PASSWORD] Appends NAME credential with optional password to the database. If diff --git a/passman b/passman index b71f206..0032fcb 100755 --- a/passman +++ b/passman @@ -1,6 +1,6 @@ #!/bin/sh -e # passman -- simple password manager -# Copyright (C) 2013-2023 Sergey Matveev (stargrave@stargrave.org) +# Copyright (C) 2013-2025 Sergey Matveev # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,19 +18,21 @@ DB=${PASSMANDB:-$HOME/.passmandb} dec() { if [ -s $DB ] ; then - age -d $DB | zstd -d + # age -d $DB | zstd -d + cmenctool -p -d <$DB | zstd -d else cat < $tmp + dec | recsel -e "name ~ '$1'" >$tmp [ $(recsel -c $tmp) -eq 1 ] || { - recsel -C -P Name $tmp + recsel -C -P name $tmp exit 1 } } commit() { - enc < $tmp > ${DB}.tmp + enc <$tmp >${DB}.tmp fsync ${DB}.tmp mv ${DB}.tmp $DB } @@ -71,21 +73,21 @@ add) [ -n "$dst" ] [ -n "$passwd" ] || passwd=$(generator) echo ${dst}... - dec | recins -t Credential -f Name -v "$dst" -f Passwd -v "$passwd" > $tmp + dec | recins --verbose -t credential -f name -v "$dst" -f passwd -v "$passwd" >$tmp commit ;; mod) - dec > $tmp + dec >$tmp $EDITOR $tmp commit ;; *) finder "$1" - name=$(recsel -P Name $tmp) + name=$(recsel -P name $tmp) echo $name >&2 - data=$(recsel -P Data $tmp) + data=$(recsel -P data $tmp) [ -z "$data" ] || echo "Associated data: $data" - echo -n $(recsel -P Passwd $tmp) | cliper clipboard + echo -n $(recsel -P passwd $tmp) | cliper clipboard echo -n ${name##*/} | cliper primary sleep 10 echo -n | cliper clipboard