Silk Road forums

Discussion => Security => Topic started by: Maxerox on December 19, 2012, 07:20 am

Title: Message encrypted but still un readable
Post by: Maxerox on December 19, 2012, 07:20 am
Hey there,
I'm pretty new with gpg and I still have a lot to learn. I check the forum but couldn't find where I did wrong and why my friend can't open the encrypted file I sent him.
I'm running on a 10.7 Mac so I use gpg tools
The step by step of my actions:

   1.  Copy/Paste the public key of my friend into text edit.
    2. Save in format rtf then export it to gpg key chain access
    3. Type my message into text edit.
    4. Select the text I've written and encrypt it.
    ( A window pop up asking me to choose a recipient)
    5. Select the public key of my friend I've just imported on gpg key chain access
    ( Here if I don't select a secret key at the bottom of the window I receive this message: "Encryption canceled" No private key selected to add recipients)
    6. So I select and have only one choice: My secret key.
    Which I suppose is logic because for what I read i encrypt a message with the public key of someone and sign with this private key.
    7. Message encrypted and ready to go
    Now did I do something wrong in all these steps? Why my friend can't read what I send to him?

Thanks and sorry if this topic already exist and if so please send me to it :)
Title: Re: Message encrypted but still un readable
Post by: Nightcrawler on December 19, 2012, 08:38 pm
Hey there,
I'm pretty new with gpg and I still have a lot to learn. I check the forum but couldn't find where I did wrong and why my friend can't open the encrypted file I sent him.
I'm running on a 10.7 Mac so I use gpg tools
The step by step of my actions:

   1.  Copy/Paste the public key of my friend into text edit.
    2. Save in format rtf then export it to gpg key chain access

That is your first mistake -- the message needs to be in text format, not .rtf.

    3. Type my message into text edit.
    4. Select the text I've written and encrypt it.
    ( A window pop up asking me to choose a recipient)
    5. Select the public key of my friend I've just imported on gpg key chain access
    ( Here if I don't select a secret key at the bottom of the window I receive this message: "Encryption canceled" No private key selected to add recipients)

You have to UNCHECK the Add to Recipients box. Also UNCHECK the signing box -- you do _not_ want to sign your message.

    6. So I select and have only one choice: My secret key.
    Which I suppose is logic because for what I read i encrypt a message with the public key of someone and sign with this private key.

You NEVER, EVER sign messages unless you absolutely have to. Any message that is PGP-signed, once the signature verifies, cannot be disavowed as a forgery.

    7. Message encrypted and ready to go
    Now did I do something wrong in all these steps? Why my friend can't read what I send to him?

Thanks and sorry if this topic already exist and if so please send me to it :)

Your first mistake is using .rtf format -- you should be using plain text format. You can change the default in TextEdit preferences.
Rich Text format is a text markup language, like HTML. PGP doesn't always react well to marked-up messages, whether it it .rtf or HTML.

Here are some instructions you can follow:
GPGTools is highly version dependent -- depending on which version of OS X you have, it may or may not work as expected.  If you have Leopard (10.5) then you're pretty much out of luck. Your only option then will be using the command-line.

If you have Snow Leopard (10.6), Lion (10.7) or Mountain Lion (10.8), the following instructions should be sufficient to allow you to get up and running.

Download and install GPGTools: http://nightly.gpgtools.org/GPGTools_Installer-trunk.dmg

Once you have installed GPGTools,  what you want to do is to go into System Preferences --> Keyboard --> Services.

Scroll down until you find the following entries. Be sure to put a check mark in the boxes to activate each keyboard shortcut.

Keyboard shortcuts:

OpenPGP: Decrypt Selection:             Shift-Command-D

OpenPGP: Encrypt Selection:             Shift-Command-E

OpenPGP: Import Key from Selection:     Shift-Command-I

OpenPGP: Insert My Fingerprint:         Shift-Command-F

OpenPGP: Insert My Key:                 Shift-Command-K

OpenPGP: Sign Selection:                Shift-Command-R

OpenPGP: Verify Signature of Selection: Shift-Control-V

Remember, these shortcuts only operate on highlighted or selected text.

N.B.: To properly be able to import PGP into GPGChain (via TextEdit) you need to change the default on TextEdit from .rtf to plain text. You can do that through the Format menu, or you can go through the main configuration menu, accessible by using Command-comma. Ensure the plain text radio button is selected.

Also ensure that the following are UNCHECKED in TextEdit preferences: smart quotes, smart dashes, smart links.

To select text within TextEdit, use Command-A to highlight the entire document, or use your mouse to selection the section that you want to verify/sign/encrypt/decrypt. It is highly recommended that you use only plain-text, as opposed to Rich Text (.rtf) format. Use Command-comma to bring up Preferences and ensure that the plain text radio button is checked.

Once your text is highlighted in TextEdit, (by pressing Comand-A) you then encrypt using Shift-Command-E. You will then be presented with a list of keys to encrypt to, that you have added to your PGP keyring:

Other Commands You May Need:
=========================

OpenPGP: Decrypt File:                   Control-Command-D

OpenPGP: Encrypt File:                   Control-Command-E

OpenPGP: Sign File:                      Control-Command-S

OpenPGP: Verify Signature of File:       Control-Command-V


Once you have setup these shortcuts, you can begin using GPG.

To encrypt a message to someone using GPG, you first need a copy of the recipient's PGP public key.

Once you have located someone's PGP public key, you should copy and paste it into TextEdit. Save the PGP key to a file; you can call the file, import.asc (or import.txt), for example. This saved file will usually be found in the Documents folder.

Launch GPG Keychain Access from the Applications folder. click on the Import icon in the upper left hand corner. GPG Keychain Access will then prompt you for the name of the file which contains the key to import. It will usually show you a list of files in the Documents folder. Click on the file named import.asc (or import.txt), and click ok. The PGP public key will then be imported into your PGP keyring.

To encrypt a message to a person, the message must be contained in a TextEdit document. Use Command-A to hightlight the entire document. Then use Shift-Command-E to encrypt. GPG will pop-up a list of public keys in your PGP keyring. Each key will have a little checkbox beside it which you can check, to select that particular key. If you were encrypting a message to me, you would put a check in the box beside my PGP key (Guru@SR).

When you click on OK, the plaintext (unencrypted) message in TextEdit will be replaced with the encrypted message. You can then copy and paste the encrypted message to enter it into a form on Silk Road, or anywhere else that it needs to go.

To decrypt a message sent to you by other people, you need to copy that message to the clipboard, and paste it into a TextEdit document. Again use Command-A to highlight all the encrypted message. Then use Shift-Command-D to decrypt the message. If the message is encrypted to your PGP public key, you will be prompted to enter your passphrase. Once the correct passphrase has been entered, and you click OK, then the message will be decrypted, and the decrypted text will be placed in the TextEdit document, replacing the encrypted message that was there previously.

Guru (original author)
Title: Re: Message encrypted but still un readable
Post by: Maxerox on December 20, 2012, 02:24 am
Wow Guru... I wasn't expecting someone who could go that straight to the point with the clearest explanations I've ever read on the entire forum!
You're officially my master in GPG! Thank you so much, I was really desperate.
 I've read a lot about this format thing but was only seeing this .asc and I don't have that in my text edit preferences.
.txt makes definitely much more sense to me!
For the rest well thanks for your warning, I was far away from thinking that signing in this case could be dangerous (sounds a bit dumb when I say that though)
Will try all the tips you gave me on the gpg club and see what's up.
I hope my mistakes and the great explanations I got from you will help the rest of the mac users!!!
Thank you very much Guru
Title: Re: Message encrypted but still un readable
Post by: Nightcrawler on December 20, 2012, 03:22 am
Wow Guru... I wasn't expecting someone who could go that straight to the point with the clearest explanations I've ever read on the entire forum!
You're officially my master in GPG! Thank you so much, I was really desperate.
 I've read a lot about this format thing but was only seeing this .asc and I don't have that in my text edit preferences.
.txt makes definitely much more sense to me!
For the rest well thanks for your warning, I was far away from thinking that signing in this case could be dangerous (sounds a bit dumb when I say that though)
Will try all the tips you gave me on the gpg club and see what's up.
I hope my mistakes and the great explanations I got from you will help the rest of the mac users!!!
Thank you very much Guru

For what it's worth, I'm not Guru -- I'm Nightcrawler. I just borrowed Guru's tutorial. Unfortunately, Guru is no longer on the Forum.  I'm glad that you found the tutorial valuable.

NC
Title: Re: Message encrypted but still un readable
Post by: Maxerox on December 20, 2012, 03:34 am
True, thx NC too then ;)