Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://linux.101hacks.com/unix/gpg-command-examples/
- #List GPG Keys
- gpg --list-public-keys
- gpg --gen-key
- Username is samuel
- #Export Key
- #Encrypt
- gpg --recipient samuel --encrypt file.txt
- #Decrypt
- gpg --decrypt file.txt.gpg > file1.txt
- 3Ec@lvgEim1*KaDp
- #to export a private key:
- gpg --export-secret-key -a "samuel" > samuel_private.key
- #to import a public key:
- gpg --import samuel_public.pub
- This adds the public key in the file "samuel_public.pub" to your public key ring.
- #to import a private key:
- gpg --allow-secret-key-import --import samuel_private.key
- This adds the private key in the file "private.key" to your private key ring. There's a note (*) at the bottom explaining why you may want to do this.
- #Revoke a Key
- gpg --gen-revoke <keyID>
- =========================
- OpenSSL
- http://rietta.com/blog/2012/01/27/openssl-generating-rsa-key-from-command/
- The generated files are base64-encoded encryption keys in plain text format.
- Generate a 2048 bit RSA Key:
- openssl genrsa -des3 -out private.pem 2048
- mD4g^9B6gY7rMYh4
- Export the RSA Public Key to a File:
- openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Advertisement
Add Comment
Please, Sign In to add comment