{"action":"created","issue":{"url":"https://api.github.com/repos/dyne/Tomb/issues/179","labels_url":"https://api.github.com/repos/dyne/Tomb/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/dyne/Tomb/issues/179/comments","events_url":"https://api.github.com/repos/dyne/Tomb/issues/179/events","html_url":"https://github.com/dyne/Tomb/issues/179","id":51356335,"number":179,"title":"Do not prompt for Tomb password if secret key material doesn't need one","user":{"login":"alphazo","id":632755,"avatar_url":"https://avatars.githubusercontent.com/u/632755?v=3","gravatar_id":"","url":"https://api.github.com/users/alphazo","html_url":"https://github.com/alphazo","followers_url":"https://api.github.com/users/alphazo/followers","following_url":"https://api.github.com/users/alphazo/following{/other_user}","gists_url":"https://api.github.com/users/alphazo/gists{/gist_id}","starred_url":"https://api.github.com/users/alphazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphazo/subscriptions","organizations_url":"https://api.github.com/users/alphazo/orgs","repos_url":"https://api.github.com/users/alphazo/repos","events_url":"https://api.github.com/users/alphazo/events{/privacy}","received_events_url":"https://api.github.com/users/alphazo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dyne/Tomb/labels/feature","name":"feature","color":"444444"}],"state":"open","locked":false,"assignee":{"login":"jaromil","id":148059,"avatar_url":"https://avatars.githubusercontent.com/u/148059?v=3","gravatar_id":"","url":"https://api.github.com/users/jaromil","html_url":"https://github.com/jaromil","followers_url":"https://api.github.com/users/jaromil/followers","following_url":"https://api.github.com/users/jaromil/following{/other_user}","gists_url":"https://api.github.com/users/jaromil/gists{/gist_id}","starred_url":"https://api.github.com/users/jaromil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaromil/subscriptions","organizations_url":"https://api.github.com/users/jaromil/orgs","repos_url":"https://api.github.com/users/jaromil/repos","events_url":"https://api.github.com/users/jaromil/events{/privacy}","received_events_url":"https://api.github.com/users/jaromil/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dyne/Tomb/milestones/7","html_url":"https://github.com/dyne/Tomb/milestones/2.1","labels_url":"https://api.github.com/repos/dyne/Tomb/milestones/7/labels","id":912611,"number":7,"title":"2.1","description":null,"creator":{"login":"jaromil","id":148059,"avatar_url":"https://avatars.githubusercontent.com/u/148059?v=3","gravatar_id":"","url":"https://api.github.com/users/jaromil","html_url":"https://github.com/jaromil","followers_url":"https://api.github.com/users/jaromil/followers","following_url":"https://api.github.com/users/jaromil/following{/other_user}","gists_url":"https://api.github.com/users/jaromil/gists{/gist_id}","starred_url":"https://api.github.com/users/jaromil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaromil/subscriptions","organizations_url":"https://api.github.com/users/jaromil/orgs","repos_url":"https://api.github.com/users/jaromil/repos","events_url":"https://api.github.com/users/jaromil/events{/privacy}","received_events_url":"https://api.github.com/users/jaromil/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2014-12-22T19:33:58Z","updated_at":"2015-02-22T02:18:40Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2014-12-08T21:43:31Z","updated_at":"2015-07-23T16:04:45Z","closed_at":null,"body":"There is one little last issue with the GnuPG setup. When I open the Tomb container with a GnuPG encrypted keyfile I first get prompted for a Tomb password for which I can type anything since it no longer applies and then I get the GnuPG password prompt.\r\nWould be nice if Tomb first tried to use the GnuPG *unprotected* secret instead of prompting for a password?\r\n\r\n## Generating a 100MB empty tomb\r\n\r\n    # tomb dig -s 100 test.tomb\r\n     tomb  .  Commanded to dig tomb test.tomb\r\n     tomb (*) Creating a new tomb in ./test.tomb\r\n     tomb  .  Generating test.tomb of 100MiB\r\n     100+0 records in\r\n     100+0 records out\r\n     104857600 bytes (105 MB) copied, 8,55695 s, 12,3 MB/s\r\n     -rw------- 1 alpha users 100M  7 déc.  12:20 ./test.tomb\r\n     tomb (*) Done digging test\r\n     tomb  .  Your tomb is not yet ready, you need to forge a key and lock it:\r\n     tomb  .  tomb forge ./test.tomb.key\r\n     tomb  .  tomb lock ./test.tomb -k ./test.tomb.key\r\n\r\n## Creating the encryption key and using a dummy temporary password to protect it\r\n\r\nPassword in that case is \"weak\".\r\n\r\n     tomb forge test.tomb.key\r\n     tomb  .  Commanded to forge key test.tomb.key\r\n     tomb [W] An active swap partition is detected, this poses security risks.\r\n     tomb (*) All your swaps are belong to crypt.  Good.\r\n     tomb  .  Commanded to forge key test.tomb.key with cipher algorithm AES256\r\n     tomb  .  This operation takes time, keep using this computer on other tasks,\r\n     tomb  .  once done you will be asked to choose a password for your tomb.\r\n     tomb  .  To make it faster you can move the mouse around.\r\n     tomb  .  If you are on a server, you can use an Entropy Generation Daemon.\r\n     256+0 records in\r\n     256+0 records out\r\n     256 bytes (256 B) copied, 111,361 s, 0,0 kB/s\r\n     tomb (*) Choose the  password of your key: test.tomb.key\r\n     tomb  .  (You can also change it later using 'tomb passwd'.)\r\n     [GNUPG:] PROGRESS need_entropy X 8 16\r\n     [GNUPG:] PROGRESS need_entropy X 16 16\r\n     [GNUPG:] NEED_PASSPHRASE_SYM 9 3 2\r\n     [GNUPG:] BEGIN_ENCRYPTION 2 9\r\n     [GNUPG:] END_ENCRYPTION\r\n     tomb  .  Key is valid.\r\n     tomb  .  Done forging test.tomb.key\r\n     tomb (*) Your key is ready:\r\n     -rw------- 1 alpha users 531  7 déc.  12:26 test.tomb.key\r\n\r\n## Encrypt and format container with previously generated key\r\n\r\n     # tomb lock test.tomb -k test.tomb.key\r\n     tomb  .  Commanded to lock tomb test.tomb\r\n     tomb  .  Checking if the tomb is empty (we never step on somebody else's bones).\r\n     tomb  .  Fine, this tomb seems empty.\r\n     tomb  .  Key is valid.\r\n     tomb  .  Locking using cipher: aes-xts-plain64:sha256\r\n     tomb  .  A password is required to use key test.tomb.key\r\n     tomb  .  Password OK.\r\n     tomb (*) Locking test.tomb with test.tomb.key\r\n     tomb  .  Formatting Luks mapped device.\r\n     tomb  .  Formatting your Tomb with Ext3/Ext4 filesystem.\r\n     tomb  .  Done locking test using Luks dm-crypt aes-xts-plain64:sha256\r\n     tomb (*) Your tomb is ready in ./test.tomb and secured with key test.tomb.key\r\n\r\n## Open the container with 'weak' password:\r\n\r\n     # tomb open test.tomb -k test.tomb.key\r\n     tomb  .  Commanded to open tomb test.tomb\r\n     tomb [W] An active swap partition is detected, this poses security risks.\r\n     tomb (*) All your swaps are belong to crypt.  Good.\r\n     tomb  .  Valid tomb file found: ./test.tomb\r\n     tomb  .  Key is valid.\r\n     tomb  .  Mountpoint not specified, using default: /media/test.tomb\r\n     tomb (*) Opening test.tomb on /media/test.tomb\r\n     tomb  .  This tomb is a valid LUKS encrypted device.\r\n     tomb  .  Cipher is \"aes\" mode \"xts-plain64:sha256\" hash \"sha1\"\r\n     tomb  .  A password is required to use key test.tomb.key\r\n     tomb  .  Password OK.\r\n     tomb (*) Success unlocking tomb test\r\n     tomb  .  Checking filesystem via /dev/loop0\r\n     fsck from util-linux 2.25.2\r\n     test: clean, 11/25168 files, 8848/100352 blocks\r\n     tomb (*) Success opening test.tomb on /media/test.tomb\r\n\r\n## Bury something in the tomb\r\n\r\n     # touch /media/test.tomb/mydirtylittlesecrets.txt\r\n\r\n## Close tomb\r\n\r\n     # tomb close\r\n\r\n## Encrypt key material with GnuPG key\r\n\r\n     # gpg -d test.tomb.key | gpg -e -r 0x242D4DFB --armor -o test.tomb.key.gpg\r\n     gpg: AES256 encrypted data\r\n     gpg: 0x00D7B31FCBF93DD2: There is no assurance this key belongs to the named user\r\n     pub  elg2048/0x00D7B31FCBF93DD2 2009-08-20 Alphazo <alphazo@gmail.com>\r\n      Primary key fingerprint: D521 F47D 3A10 41E5 71A1  E4CD 6338 F4BC 242D 4DFB\r\n           Subkey fingerprint: 14E0 A6FB 37C8 24B4 4745  5FE0 00D7 B31F CBF9 3DD2\r\n      gpg: encrypted with 1 passphrase\r\n\r\n## Time to securely wipe the password encrypted original key material\r\n\r\n     # wipe test.tomb.key\r\n\r\n## Open the tomb using GnuPG password protected key\r\n\r\n**The issue comes here since Tomb will ask for a 'tomb' password but in fact anything can be entered at this point since the original password is gone.**\r\nA second window will pop-up asking for the GnuPG key password and container will be mounted.\r\n\r\n     # tomb open test.tomb -k test.tomb.key.gpg\r\n     tomb  .  Commanded to open tomb test.tomb\r\n     tomb [W] An active swap partition is detected, this poses security risks.\r\n     tomb (*) All your swaps are belong to crypt.  Good.\r\n     tomb  .  Valid tomb file found: ./test.tomb\r\n     tomb  .  Key is valid.\r\n     tomb  .  Mountpoint not specified, using default: /media/test.tomb\r\n     tomb (*) Opening test.tomb on /media/test.tomb\r\n     tomb  .  This tomb is a valid LUKS encrypted device.\r\n     tomb  .  Cipher is \"aes\" mode \"xts-plain64:sha256\" hash \"sha1\"\r\n     tomb  .  A password is required to use key test.tomb.key.gpg\r\n     tomb  .  Password OK.\r\n     tomb (*) Success unlocking tomb test\r\n     tomb  .  Checking filesystem via /dev/loop0\r\n     fsck from util-linux 2.25.2\r\n     test: clean, 16/25168 files, 8852/100352 blocks\r\n     tomb (*) Success opening test.tomb on /media/test.tomb\r\n     tomb  .  Last visit by alpha(1000) from /dev/pts/0 on fatfly\r\n     tomb  .  on date dim. 07 déc. 2014 12:28:48 CET\r\n\r\n## Check if secret files are here\r\n\r\n     # ls /media/test.tomb\r\n     lost+found  mydirtylittlesecrets.txt\r\n\r\n## Want something cool?\r\nMinus the little annoyance with the extra password prompt the above setup also works nicely with a Cryptostick GnuPG drive that holds the GnuPG decryption key (instead of being stored on your PC). It provides an extra level of security and allow a simpler PIN code to be used for unlocking the Cryptostick and decrypt the Tom container key master material. After 3 false attempts the Cryptostick locks itself down."},"comment":{"url":"https://api.github.com/repos/dyne/Tomb/issues/comments/124152471","html_url":"https://github.com/dyne/Tomb/issues/179#issuecomment-124152471","issue_url":"https://api.github.com/repos/dyne/Tomb/issues/179","id":124152471,"user":{"login":"jaromil","id":148059,"avatar_url":"https://avatars.githubusercontent.com/u/148059?v=3","gravatar_id":"","url":"https://api.github.com/users/jaromil","html_url":"https://github.com/jaromil","followers_url":"https://api.github.com/users/jaromil/followers","following_url":"https://api.github.com/users/jaromil/following{/other_user}","gists_url":"https://api.github.com/users/jaromil/gists{/gist_id}","starred_url":"https://api.github.com/users/jaromil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaromil/subscriptions","organizations_url":"https://api.github.com/users/jaromil/orgs","repos_url":"https://api.github.com/users/jaromil/repos","events_url":"https://api.github.com/users/jaromil/events{/privacy}","received_events_url":"https://api.github.com/users/jaromil/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T16:04:45Z","updated_at":"2015-07-23T16:04:45Z","body":"I postpone this one for after 2.1 release since\r\n\r\n1- we did not test it enough yet\r\n2- still does not adopts a flag instead of a file extension as discussed\r\n3- still asks for a fake password prompt going past with a blank return before working as expected\r\n \r\nRest assured this feature will go in master at some point, however just not now. Meanwhile, anyone using the `gnupg-delegation` branch is welcome to report experience, observations and fixes."}}