Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Nov 25, 2024
1 parent e1d4387 commit f20c0d7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions notes/thgtoa.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@
# examples
gpg --list-public-keys # gpg --list-keys
set gpgPubKey ...
gpg --encrypt --output file.txt.gpg --recipient $gpgPubKey file.txt
gpg --encrypt --output file.txt.gpg --recipient foo@"@"domain.org file.txt
gpg --decrypt file.txt.gpg --output file.txt
set fPlainText "file.txt"
set fEncrypted "file.txt.gpg"
gpg --encrypt --output $fEncrypted --recipient $gpgPubKey $fPlainText && shred --verbose --remove $fPlainText
gpg --encrypt --output $fEncrypted --recipient $gpgPubKey $filePlainText
gpg --encrypt --output $fEncrypted --recipient foo@"@"domain.org $filePlainText
gpg --decrypt $fEncrypted --output $filePlainText
gpg --decrypt --quiet --for-your-eyes-only --no-tty ~/.passwords/gmail.gpg

# encrypt / decrypt a folder / directory
gpgtar --encrypt --output filename.gpg --recipient $gpgPubKey /path/to/dir
gpgtar --decrypt filename.gpg
gpgtar --encrypt --output $fEncrypted --recipient $gpgPubKey /path/to/dir
gpgtar --decrypt $fEncrypted

# Encrypt Both File Content and Filename
# -c --symmetric
Expand All @@ -107,7 +110,7 @@
# Decrypt the Filename and File Content
gpg --decrypt filename.gpg > decrypted_filename.txt && \
gpg --decrypt filecontent.gpg > "$(cat decrypted_filename.txt)" && \
rm decrypted_filename.txt # or permanent delete by `shred`
rm decrypted_filename.txt # or: shred --verbose --remove decrypted_filename.txt

# -A NUM, --after-context=NUM
# man gpg | grep --after-context=2 show-usage
Expand Down

0 comments on commit f20c0d7

Please sign in to comment.