]>
git.scottworley.com Git - overonion/blob - overonion
600dafbd1839bb2bd1c48d4b84d2e179df9c62f3
4 echo "usage: overonion e|d keyfile"
8 if [[ "$mode" != e
&& "$mode" != d
]];then
9 echo "Use 'e' for encrypt or 'd' for decrypt"
13 if [[ ! -e "$keyfile" ]];then
14 echo "Keyfile not found"
17 if [[ ! -r "$keyfile" ]];then
18 echo "Cannot read keyfile"
22 num_layers
=$(wc -l < "$keyfile")
23 if (( num_layers
< 20 ));then
24 echo "Keyfile doesn't have enough layers to be an onion"
28 if [[ "$mode" == e
]];then
29 first_layer
=$num_layers
40 if (( layer
== 0 || layer
> num_layers
));then
43 openssl enc
$openssl_decrypt "-$(sed -n "${layer}s/ .*//p" "$keyfile")" \
44 -pass fd
:37 37< <(sed -n "${layer}s/^[^ ]* //p" "$keyfile") |
45 go
$(( layer + next_layer ))