Skip to content

Instantly share code, notes, and snippets.

@SanCoder-Q
Last active December 19, 2018 03:42
Show Gist options
  • Select an option

  • Save SanCoder-Q/13c8eccd9908cf11912cc9e98d3b9f0b to your computer and use it in GitHub Desktop.

Select an option

Save SanCoder-Q/13c8eccd9908cf11912cc9e98d3b9f0b to your computer and use it in GitHub Desktop.

Revisions

  1. SanCoder-Q revised this gist Dec 19, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gpg-file.sh
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,6 @@ gpg --output <file.enc> --encrypt --recipient <key recipient name / email> <file

    # decrypt file
    gpg --decrypt --output <file> <file.enc>

    # remove key
    gpg --delete-key <key recipient name / email>
  2. SanCoder-Q created this gist Dec 19, 2018.
    20 changes: 20 additions & 0 deletions gpg-file.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # install GnuPG
    brew install gpg

    # generate gpg key pair
    gpg --gen-key

    # list keys
    gpg --list-keys

    # export public key
    gpg --armor --export <pubuid> > public.key

    # import public key
    gpg --import public.key

    # encrypt file
    gpg --output <file.enc> --encrypt --recipient <key recipient name / email> <file>

    # decrypt file
    gpg --decrypt --output <file> <file.enc>