pwsafe
pwsafe copied to clipboard
Pwsafe support for V3 Database
Thank you for pwsafe.
I intended using Password Gorilla as a gui and Pwsafe as a CLI but it seems pwsafe is not compatible with V3 database format.
$ pwsafe -v --list -f /tmp/Gorilla.psafe3 rng seeded with 1024 bytes from /home/adrian/.rnd Enter passphrase for /tmp/Gorilla.psafe3: Passphrase is incorrect Enter passphrase for /tmp/Gorilla.psafe3:
Sadly, it appears that pwsafe is not being maintained any longer.
I'm pretty sure Gorilla will read your v2 database. I'm not sure that Gorilla will write a v2 database, or "force" you to convert to v3 when it writes.
What I have been doing is using pwsafe (the CLI) as my primary method of interacting with password safe, then using the below script to convert the v2 database to a v3 database, and using Gorilla as a read-only interface. I hope that helps.
(I don't remember where I got this script from, and I can't offer you any support on it.)
The command would be
./pwsafe-convert.tcl ~/.pwsafe.dat .pwsafe.psafe3
=== 8< ===
#! /bin/sh
# the next line restarts using wish \
exec tclsh8.6 "$0" ${1+"$@"}
set ::gorillaDir [ file normalize [ file dirname [ info script ] ] ]
namespace eval gorilla { variable Dir [ pwd ] }
lappend auto_path [ pwd ]
package require pwsafe
interp alias {} mc {} puts
if { [ llength $argv ] != 2 } {
puts "Usage: $argv0 input-file output-file"
exit 1
}
lassign $argv inf outf
if { ! [ file isfile $inf ] } {
puts "Error: input-file '$inf' does not exist, aborting."
exit 1
}
if { [ file exists $outf ] } {
puts "Error: output-file '$outf' exists, refusing to overwrite."
exit 1
}
puts stderr "Enter Password"
exec stty -echo
gets stdin password
exec stty echo
set newdb [ pwsafe::createFromFile $inf $password ]
pwsafe::writeToFile $newdb $outf 3
Hi hymie0 I just discovered from rich123:
Your Password Gorilla file is most likely version 3 (as Gorilla prefers V3 files unless you try really hard to make it do otherwise).
To get it to create a V2 file you'll have to:
uncheck the "use V3 format" setting in the defaults tab of the preferences pane create a new database add the passwords you want to use to the new db (merging in your V3 DB should work) Then you should have a V2 DB that will work with pwsafe. But note that V2 does not contain many of the newer nice items that V3 does, and V2 is not as secure as V3.
https://github.com/zdia/gorilla/issues/172#issuecomment-327530792
This works but see last paragraph above.
It's maintained, but I haven't got a personal reason to implement v3 format, and no one else has come up with a patch for it either.
The differences between v1 and v2 were simple. The v3 format is significantly different (it allows arbitrary fields, history, etc), which make reading and writing it require new non-trivial code. And it is not clear to me how editing a v3 entry in a CLI would work. At times I had thoughts about firing up $EDITOR and letting it deal with it.