+ Reply to Thread
Results 1 to 1 of 1

Thread: GnuPG - Importing, Exporting, Encrypting and Decrypting

  1. #1
    cthree's Avatar
    cthree is offline Tweleve Monk TwelevePlus
    TWELEVE MONK
    Ruby
    cthree will become famous soon enough
    Join Date
    Jan 2005
    Location
    O'er shut sun
    Posts
    2,044

    Default GnuPG - Importing, Exporting, Encrypting and Decrypting

    To export your public key for others to import you can do:
    Code:
    gpg --armor --export keyemail
    Where keyemail is the email you used to set up your key.

    This will print the key in terminal to easily copy. Alternatively, you can
    export to a file with the output option:

    Code:
    gpg --output mykey.gpg --export keyemail
    This file can then be sent to someone via email or traded on USB or something.

    To import someone's public key, have their public key file handy (or if you
    copy it from somewhere, just make a text file with that content and save it as an asc
    file. The do:

    Code:
    gpg --import keyfile
    You can check to see if the key was added to your ring by doing:

    Code:
    gpg - k
    So! Let's encrypt something!

    Do:

    Code:
    gpg -aer username (hit enter)
    then type your message here and then hit ctrl+d (i have to hit it twice)
    Where username is the intended recipient. This will generate armored output in
    the terminal to copy (use the output option for file).

    To decrypt in terminal (you need secret key of recipient) do:

    Code:
    gpg -d (hit enter)
    (paste armored message including headers)
    (enter passphrase when prompted)
    (ctrl +d )
    Outputs the message plaintext on screen.

    Remember, to encrypt a message only I can read, you need to use my
    public key to encrypt the message. The only thing that can unlock
    a message locked using my public key is my private key! Here's a public
    key I generated to play with here - use it to send me a message! Post your
    public key here and I'll send you one!

    Next we'll get into signing keys and messages. As always if you have any
    don't hesitate to ask.

    My test public key:

    Code:
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    
    mQINBFLOP1oBEADOK0GUSM1fUTQSM+xt0cTA8WCVs2foGTnzFQgYokVS31nid1mk
    zCCJjV1IIRq0gCdtMtloBzk5bW7/Kv1foiSbUg7lruuDHHIu0KhyEnV3OrS9Z+90
    IDUOWt1MGKsCG51HD/c0DrR3FmnRGKS28+Q2DzwOGQmvDzcuCbUEUmR6bjhOekM2
    G64nEtGkwc+0Q/e+jE7CnYG4bQ5TvWAZ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PaE0uD/9DZN4efz7Nvg2NyofctGemZi1X
    Mzw7cgTb6DqzV1PMoDV77OraiJzO3Sv4F7yzkOGxH81Es9ymrpKhvvs1hCfvjtr2
    kgGhQRK9/LJQmsRXXUmzEnrrKdW5pE10ZYwfQ+v3kcZ/xBfguvmsi7/duaM4xBfL
    ZDAgB8SbiYj6kd88lS18nhVqTlltthrCUiv85WWwgwuyjUFczDiwKCz7O0ypCMli
    sowwfxlkg7CcSIjV+uEDx+bQmmI7Bt7/7+EvKtXLgQlv5Tr7mhejs2ksSGlpX2SW
    cNCQgIm8dm7wJPW7LHwzn4t+KUfJqSZMnUR7aov8qmu/pw0wwzj3Zo10uk3QK6TQ
    mAF5Qsck2gOE5dToqxV6F7XHQymxfhrAtu9kYbhJIFvxHhVXdQOBkF+gVe1syDOM
    sezttpkj6G9XwngyngSMoKPvGByS2/tSBOOyeghmf5yYvO9bY6L+3QDXJ14tO6UT
    ud+TCDkWWNrbRJv2forRCmGaeP6ANPw8o3RefgpD7lv+vUGA0wQr2Q8OuNxozGqx
    M/ZOovc/oLhE7Kql2OV4SkL0FHBMPgjCmhI90zfCyS2YdJZCiP1sEinudZEdXisf
    Lx+c5IyJe7csx0gLMZuHwcehlvOII/Fef/4QdICMmFz2a1YA9/ro32x/efnMeVE6
    prAoYfQFebIJYqctgw==
    =GVrq
    -----END PGP PUBLIC KEY BLOCK-----
    PS - I removed the version info from my key via the --no-version option
    Last edited by cthree; 01-09-2014 at 07:25 AM. Reason: added key

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts