~ecryptfs/ecryptfs/trunk

« back to all changes in this revision

Viewing changes to src/utils/ecryptfs-record-passphrase

  • Committer: Dustin Kirkland
  • Date: 2012-01-23 03:14:50 UTC
  • Revision ID: dustin.kirkland@gmail.com-20120123031450-2te42mng2hqidxs9
* doc/manpage/ecryptfs-record-passphrase.1, src/desktop/ecryptfs-
  record-passphrase, src/utils/ecryptfs-record-passphrase,
  src/utils/Makefile.am:
  - create an interactive, educational wrapper for recording a passphrase

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#    ecryptfs-record-passphrase
 
3
#    Copyright (C) 2012 Dustin Kirkland <dustin.kirkland@gmail.com>
 
4
#
 
5
#    Authors: Dustin Kirkland <dustin.kirkland@gmail.com>
 
6
#
 
7
#    This program is free software; you can redistribute it and/or modify
 
8
#    it under the terms of the GNU General Public License as published by
 
9
#    the Free Software Foundation; version 2 of the License.
 
10
#
 
11
#    This program is distributed in the hope that it will be useful,
 
12
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
#    GNU General Public License for more details.
 
15
#
 
16
#    You should have received a copy of the GNU General Public License
 
17
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
msg="
 
20
Usually your encrypted directory is unlocked automatically with your LOGIN
 
21
password.  But if you ever need to manually recover your encrypted data
 
22
manually, you must have your randomly generated MOUNT passphrase.
 
23
 
 
24
YOU MUST RECORD THIS MOUNT PASSPHRASE AND STORE IT SOMEWHERE SAFE!
 
25
 
 
26
You can:
 
27
 (1) Enter your LOGIN password, display and manually write down your
 
28
     randomly generated MOUNT passphrase
 
29
 (2) Backup your randomly generated MOUNT passphrase to KeyEscrow.net
 
30
     (or compatible) key escrow service in the Cloud.
 
31
 
 
32
Enter your choice [1-2]: "
 
33
 
 
34
while true; do
 
35
        echo -n "$msg"
 
36
        choice=$(head -n1)
 
37
        case "$choice" in
 
38
                1)
 
39
                        exec ecryptfs-unwrap-passphrase "$HOME/.ecryptfs/wrapped-passphrase"
 
40
                ;;
 
41
                2)
 
42
                        exec ecryptfs-escrow-private
 
43
                ;;
 
44
        esac
 
45
done