Gocryptfs: Get the master key programmatically after mounting?

Created on 27 Feb 2017  路  3Comments  路  Source: rfjakob/gocryptfs

Hi, what is the best way to get the master key into a text file on a terminal after a volume has been mounted? Thank you!

question

Most helpful comment

I have added this functionality to gocryptfs-xray. Example:

$ ./gocryptfs-xray -dumpmasterkey a/gocryptfs.conf
Password: ****
f327fe03b846d6ad11db4b8eab3344b052f82604db1262c90e3ae544cd8a28e7

Piping the password:

$ cat pwd.txt | ./gocryptfs-xray -dumpmasterkey a/gocryptfs.conf 2> /dev/null
Reading password from stdin
f327fe03b846d6ad11db4b8eab3344b052f82604db1262c90e3ae544cd8a28e7

All 3 comments

Currently no way to do that. The master key was only meant to be shown to the user and I tried to make sure it does not end up in log files etc.

What is your use case?

Well, I worked on a text terminal until I got more file descriptors. :) Without piping, there was no way to print the master key.

Also, in the future I may keep a copy of the key centrally to make it easier and safer to change passwords. There is a possibility it will be encrypted with something other than the password. Thank you!

I have added this functionality to gocryptfs-xray. Example:

$ ./gocryptfs-xray -dumpmasterkey a/gocryptfs.conf
Password: ****
f327fe03b846d6ad11db4b8eab3344b052f82604db1262c90e3ae544cd8a28e7

Piping the password:

$ cat pwd.txt | ./gocryptfs-xray -dumpmasterkey a/gocryptfs.conf 2> /dev/null
Reading password from stdin
f327fe03b846d6ad11db4b8eab3344b052f82604db1262c90e3ae544cd8a28e7
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rprieto picture rprieto  路  9Comments

pepa65 picture pepa65  路  5Comments

pepa65 picture pepa65  路  8Comments

pos42 picture pos42  路  14Comments

diegoarioza picture diegoarioza  路  4Comments