• Generate a random password:

    1 $ openssl rand -base64 18
  • Examine ASN.1 structure of a CSR:

    1 $ openssl asn1parse -i -in ./0000_csr-certbot.pem
  • Generate a key (interactive mode):

    1 $ gpg --gen-key
  • You can use the key generator in an unattended mode. Values in the example below are the same as the defaults proposed in the interactive mode above. Parameters in comments are there for reference:

     1 $ gpg --gen-key --batch <<EOF
     2   Key-Type: RSA
     3   Key-Length: 2048
     4   Subkey-Type: RSA
     5   Subkey-Length: 2048
     6   Expire-Date: 0
     7   Name-Real: Kevin
     8   # Name-Email: [email protected]
     9   # Name-Comment: My auto-generated key
    10   # Passphrase: my_secret_passphrase
    11   EOF
  • List available keys for the current user:

    1 $ gpg --list-keys
  • Decrypt a file:

    1 $ gpg --decrypt archive.001.tar.gpg --output archive.001.tar
  • Same as above but for a collection of files:

    1 $ gpg --multifile --decrypt archive.*.tar.gpg