gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "[email protected]"
gpg --gen-key
- Set realname: Name Surname
- Set eamil: [email protected]
- Set strong password
gpg --list-keys
gpg --delete-secret-keys {PUBLIC_KEY}
gpg --delete-keys {PUBLIC_KEY}
gpg --output /path/to/keys/public.pgp --armor --export {PUBLIC_KEY}
gpg --output /path/to/keys/private.pgp --armor --export-secret-key {PUBLIC_KEY}
gpg --output backupkeys.pgp --armor --export-secret-keys --export-options export-backup
This will export all necessary information to restore the secrets keys
including the trust database information. Make sure you store any backup
secret keys off the computing platform and in a secure physical location.
gpg --import private.gpg
As public key generated from private, you don't need to import public.gpg
gpg -s myfile.txt
gpg -e myfile.txt
\
- Enter your public key or email OR recipient (friend, college or otherwise) public key. If you want to encrypt file to your friend by email, you should add them public keys to your keyring
gpg --import friend_public.gpg
- Enter empty line
- Done
Encrypt to custom file:
gpg --output mysecretfile.txt -e myfile.txt
To read contents:
gpg -d myfile.txt.gpg
To decrypt to file
gpg --output myfile.txt -d myfile.txt.gpg