/GPG-RSA-Git-encryption-1026-4096bits

Git built-in GPG→RSA 1026-4096 bits File-Encryption (high) & Personal keys setup @ PATH.

GNU General Public License v3.0GPL-3.0

GPG RSA Encryption


  GPG Encryption

There are plenty of time consuming encryption programs, nevertheless git provides most of the best encryptions right from your terminal.
This is due to the fact of git file(s) processing efficiency as you already know.

(Optional:) A file anyone must be wanting to encrypt if using Windows OS might be the .crd:

rem Back Up @ PATH
rundll32.exe keymgr.dll,KRShowKeyMgr %USERNAME%.crd 
rem Read saved .crd
rundll32.exe keymgr.dll,KRShowKeyMgr PATH.crd
rem Encrypt.crd...



1026-4096 bits (low → high) GPG encryption:

  1. Create Git built-in Encryption:
gpg --version #GPG Installation
gpg --gen-key # Create GPG key with default options.
gpg --full-generate-key # Create GPG key with advanced options.
gpg --list-keys # Retrieve GPG (Confirm).  

Advanced / Default options Encryption key user prompt (among others):

  • <Name>
  • <Email>
  • <Passphrase>

  • (Optional:) Key(s) deletion:

    gpg --delete-keys #Delete public keys.
    gpg --delete-secret-keys #Delete secret keys.

  1. Add Encryption key to Environment PATH for further use:
which gpg # Obtain key PATH.
export PATH=$PATH:/usr/bin/ && echo $PATH # Export GPG keys to System Env & confirm.   

  1. GPG file(s) Encryption with key:
gpg --encrypt --recipient <Email> <path/filename>
git rm <filename> -f #Delete unencrypted file to backup on cloud (Check local/remote .git).

  • (Optional:) Encrypted files Cloud back-up:

    gpg --decrypt Key.crd.gpg > Key.crd
    rundll32.exe keymgr.dll,KRShowKeyMgr PATH.crd (Optional) 

References: