6 examples for gpg

{{ score }}
  # Encrypt doc.txt for bob
gpg --output doc.gpg --encrypt --recipient bob@domain.org doc.txt

# Decrypt doc.gpg
gpg --output doc.txt --decrypt doc.gpg

# Generate a new key pair
gpg --gen-key

# Search for a public key online
gpg --search-keys bob@domain.org

# Export a public key
gpg --armor --export bob@domain.org

# Import a public key
gpg --import keyfile

# Export a private key
gpg --export-secret-key bob@domain.org

# Import a private key
gpg --allow-secret-key-import --import private.key

# Mark a key as trusted. At prompt: trust, 5, save
gpg --edit-key bob@domain.org

# Validate a key by signing it with your own key. At prompt: fpr, sign
gpg --edit-key bob@domain.org
        
{{ score }}
  # This will get you from no GPG
# to decyphering a file from your 
# neighbourhood spider-man quickly

gpg --gen-key
gpg --send-key (your id) 
gpg --recv-keys 0x********
gpg --list-keys (name of recipient)
gpg --fingerprint (name of recipient)
gpg --sign-key (name of recipient)
gpg --edit-key (name of recipient)
> gpg# trust (follow UI and type quit to save)
gpg --output *.txt.gpg --encrypt --recipient user@domain.net *.txt
        
{{ score }}
  # Decryption of symetricaly encrypted file message
gpg -d ./message
        
{{ score }}
  # Encrypt a file with a password.  Outputs file.txt.gpg
gpg --symmetric --cipher-algo AES256 file.txt

# Decrypt a file
gpg -d file.txt.gpg -o file.txt
        
{{ score }}
  # Basic encryption of file message with AES256 without caching the key localy
gpg --cipher-algo AES256 --no-symkey-cache -c ./message
        
{{ score }}
  # Encrypt and decrypt a directory
gpgtar --encrypt --output  -r  
gpgtar --decrypt