3 EDITOR
='/usr/bin/nano';
4 ccrypt
='/usr/bin/ccrypt'
7 #code##############################################
8 #if [[ -z "$EDITOR" ]]; then EDITOR='/usr/bin/nano'; fi;
10 TMPPIPE
="/tmp/ccrypt-nano-pipe-$UID-$$"
12 if [[ -z "$CRYPTFILE" ]]; then
13 echo Usage
: "$0" file.txt.cpt
;
15 This script allows you to create/edit ccenrypted textfiles using nano.
16 There is no copy of unencrypted file on filesystem everything is in pipes.
17 You can use this as secure way to keep your passwords or phone numbers (etc...).
18 Check man ccrypt & man nano for more informations."
22 if [[ -a "$CRYPTFILE" ]]; then
24 while [[ $?
!= 0 ]]; do
25 echo -ne '\nEnter password: '
26 stty
-echo; read KEY
; stty
echo;
27 $ccrypt -c "$CRYPTFILE" -K "$KEY" > /dev
/null
;
31 while [[ "$KEY" != "$KEYY" ]]; do
32 echo -ne '\n\nEnter password: '
33 stty
-echo; read KEY
; stty
echo;
34 echo -ne '\nEnter password (again): '
35 stty
-echo; read KEYY
; stty
echo;
45 $ccrypt -d -c -K "$3" "$1" > "$2";
47 while [[ -a "$2" ]]; do
48 cat "$2" |
$ccrypt -e -K "$3" |
$LAZYTEE "$1";
52 handle_crypt_pipe
"$CRYPTFILE" "$TMPPIPE" "$KEY" &
55 kill -s SIGINT $
(jobs -p); > /dev
/null
2>&1
56 kill -s SIGKILL $
(jobs -p); > /dev
/null
2>&1
This page took 0.991623 seconds and 4 git commands to generate.