Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for file in 'ls Testing'; do (echo <password>|gpg --passphrase-fd 0 -d $file
- --output $file.decrypted);
- --passphrase-fd n
- Read the passphrase from file descriptor n. Only the first line will be read from file descriptor n. If you use 0 for n, the passphrase will be read from
- STDIN. This can only be used if only one passphrase is supplied. Note that this passphrase is only used if the option --batch has also been given. This is
- different from gpg.
- --passphrase string
- Use string as the passphrase. This can only be used if only one passphrase is supplied. Obviously, this is of very questionable security on a multi-user sys‐
- tem. Don't use this option if you can avoid it. Note that this passphrase is only used if the option --batch has also been given. This is different from
- gpg.
- echo "passphrase" | gpg --passphrase-fd 0 --batch -d --output "decrypted.file" "file.gpg"
- gpg --passphrase "passphrase" --batch -d --output "decrypted.file" "file.gpg"
- #!/bin/bash
- read -rsp "Enter passphrase: " PASSPHRASE
- for FILE in *.*.gpg; do
- echo "Extracting $FILE to ${FILE%.gpg}."
- echo "$PASSPHRASE" | gpg --passphrase-fd 0 --batch -d --output "${FILE%.gpg}" "$FILE"
- done
- gpg --passphrase-fd 0 --decrypt-files *.gpg
- gpg --decrypt-files *.gpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement