Silk Road forums

Discussion => Security => Topic started by: android465764E on May 11, 2013, 07:16 pm

Title: *.pgp or *.gpg?
Post by: android465764E on May 11, 2013, 07:16 pm
So I'm playing around with an Android app called APG.

Basically I paste a key into a text file, and save it as KEY.PGP  ..I then import it into the app, and encrypt a message.
The encrypted message is dumped onto the clipboard and I paste that back to the key's owner. Simples.

However, sometimes the message is unreadable, unless I rename the extension of the key to .GPG instead.

Can someone explain, how do I know/find out, when to use which extension?
Title: Re: *.pgp or *.gpg?
Post by: livestr0ng on May 12, 2013, 04:19 am
bumping for you
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 12, 2013, 05:44 am
I have used APG, and various other versions of GPG. I always paste keys into .asc  files or .txt files , as well as the encrypted message. I think the .gpg extension is for encrypting data, .asc extension encrypts the text within a file.
        Not sure how this apply to your problem, but if I use APG, I would copy the key into a notepad type app and save it as a .asc or . txt file, import the key from there. 
      Not used it for a while let me go have a play, but I never had any problems. I remember from using command line GPG that . gpg extension would cause it to encrypt files as data
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 12, 2013, 05:59 am
After a quick check, if you are copying a public key block of text to a file you should use .asc extension to import it to APG. .gpg and .pgp key files are something different. The person would have to export his key as a keyfile with one of those extensions; you can't just rename a text file .gpg.
       Also when you encrypt, select encrypt message, rather than encrypt file. Encrypt file will encrypt the data, outputting a .gpg file. Encrypt message will encrypt the text with 'ASCII armour', outputting a -BEGIN PGP MESSAGE type text block
      If you know this already, please excuse. I'm not trying to patronize, hope I helped
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 12, 2013, 06:04 am
Hmmm just read your post again, so sometimes naming the .txt file .pgp  doesn't work but naming it .gpg does? I am baffled. By my understanding neither of those should import a working key..... You might have to wait for Astor or pine or Louis cypher to come along.


Just to clarify, how I would use APG:

select the public key block text.

Copy it into notepad type app and save as .asc file (or save it as .txt then rename it.)

Open APG and go to settings>manage public keys>import key

Navigate to .asc file and import

Then go back to main page and select Encrypt message. In window that opens either type or paste message. Select imported key and then Encrypt to Clipboard.

Paste wherever required.

Like I say, .gpg extension usually means you are dealing with data encryption, and for SR purposes we want to encrypt text.
Title: Re: *.pgp or *.gpg?
Post by: android465764E on May 12, 2013, 09:36 am
Hmmm just read your post again, so sometimes naming the .txt file .pgp  doesn't work but naming it .gpg does? I am baffled. By my understanding neither of those should import a working key..... You might have to wait for Astor or pine or Louis cypher to come along.


Just to clarify, how I would use APG:

select the public key block text.

Copy it into notepad type app and save as .asc file (or save it as .txt then rename it.)

Open APG and go to settings>manage public keys>import key

Navigate to .asc file and import

Then go back to main page and select Encrypt message. In window that opens either type or paste message. Select imported key and then Encrypt to Clipboard.

Paste wherever required.

Like I say, .gpg extension usually means you are dealing with data encryption, and for SR purposes we want to encrypt text.



Thanks for your efforts, appreciate it.
 ★

I realise I need to encrypt a message and not a file but the problem I have is that if I use the .asc or .txt extension, then the app won't even recognize the files. ie. They don't even show up when I choose the import key option. Which I am dumbfounded by tbh because the app itself shows a message saying "please choose the .asc or .txt file.... etc"

I was under the impression that pgp and gpg were different things from the same book, as it were. I know when using other pgp software on a PC for example, you just paste the key and the program does the rest.
I HAVE to choose between pgp and gpg when saving/creating the keys.
Title: Re: *.pgp or *.gpg?
Post by: astor on May 12, 2013, 03:45 pm
It doesn't bode well for this app that its functionality depends so much on the file extension. It should depend on identifying actual PGP metadata:

-----BEGIN PGP PUBLIC KEY BLOCK-----

-----BEGIN PGP MESSAGE-----

-----BEGIN PGP SIGNED MESSAGE-----

That's what it should be looking for, regardless of the extension. I can point GPG (the reference implementation of OpenPGP) at any file with any name, and it will process it, as long as the block delineators are there.

Just saying.
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 06:13 am
Android, that does sound weird, as you say it asks for a .asc or .gpg. Mine will also accept a .txt.

Astor not sure what you mean? Surely even for GPG it has to be either a .gpg or a vanilla text file? You couldn't for instance save the key block text as a .doc or a .pdf? the versions of GPG I have used  will import keys from either
a) clipboard b) .txt or .asc  file or c) .gpg key file.    APG is exactly the same.  I'm pretty sure it uses the open source GPG code and just puts a fairly basic GUI on top of it
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 06:29 am
Sorry Astor, I stand corrected, just tried doc and docx and it imported them just the same! You were right.

Android, try navigating to the keyfile through a file manager such as ES and opening it with APG. Mine will import from .txt .asc and .doc as above.
Also, when I first navigate to file (in various apps, google drive etc.) it gives meoption to pick up file in (normal android way) or (file way). only (file way) will work with APG.  maybe this is the problem? Try installing ES file manager and doing it that way.
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 06:36 am
I just renamed it .PDF and APG recognised it just the same....I have wondered for a while, why, whichever file I tap on, APG is always one of the options. Now I know why!
Android, are you using a tablet or a phone? And is it rooted? Not sure if that's relevant but thought I'd ask
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 06:53 am
Just to belabour the point as I'm rather pleased with this discovery:
I just renamed the key with a .fatherchristmas extension and APG still imported it. Hours of fun I will have with this!   
The only suggestion I have for your problem is that perhaps it is picking up the files in the (GMAIL, MMS) way rather than (FILE) way. Like I say, whenever I select a file via ES file manager to upload to google drive, or attach to email, it gives me these options. I'd recommend you install ES file manager anyway as it rocks. It will let you navigate any computer on your WiFi network(obviously only sharing enbabled folders), and stream video to your android device from its hard drive, also cloud services such as Google drive, and FTP servers.
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 06:57 am
"enbabled" LOL I just invented a new word for encrypted.

.....edit: god its far to early and I'm talking absolute shite I'm afraid. Sorry.
Title: Re: *.pgp or *.gpg?
Post by: android465764E on May 13, 2013, 08:03 am
Issue is now sorted.

I downloaded a different file manager and now all is well.
I was previously using File Manager XT, I tried ES instead and it picks up the files no problem.

ffs, if only I'd tried that earlier. lol


Thanks for all the input guys, much appreciated. ★
Title: Re: *.pgp or *.gpg?
Post by: android465764E on May 13, 2013, 08:05 am
ES is pretty awesome actually. Allows easy backup for the market app refund hack.
Can't believe I haven't already been using this. lol
Title: Re: *.pgp or *.gpg?
Post by: Hungry ghost on May 13, 2013, 03:45 pm
Hmm tell me more about this "app refund hack" I'm fairly new to android. I take it you just copy the .apk somewhere and then get your refund within 15 mins? A lot of apps have a licence check now though? 
Title: Re: *.pgp or *.gpg?
Post by: android465764E on May 13, 2013, 04:07 pm
Hmm tell me more about this "app refund hack" I'm fairly new to android. I take it you just copy the .apk somewhere and then get your refund within 15 mins? A lot of apps have a licence check now though? 


That's it exactly.
Buy an app, back it up with ES, get a refund, re-install the backup.

I've not yet had a problem with licence checks. The only issue is when you need to update the app. You get a "you haven't paid for this app blah blah" message. In this instance I repeat the process.

Got sooooooooooo many games this way.

Open ES. Click "app manger" > long-press on any app/game > click "backup". Done.