10

There's PGP public key block posted on some websites (eg. http://phrack.org/index.html).

It's not hex code. it uses much more alphabet characters. What is it?

Why is this information posted? how can i use it?

3 Answers 3

4

Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication. PGP is often used for signing, encrypting and decrypting texts, E-mails, files, directories and whole disk partitions to increase the security of e-mail communications.

Cryptography is the science of using mathematics to encrypt and decrypt data. Cryptography enables you to store sensitive information or transmit it across insecure networks (like the Internet) so that it cannot be read by anyone except the intended recipient.

While cryptography is the science of securing data, cryptanalysis is the science of analyzing and breaking secure communication. Classical cryptanalysis involves an interesting combination of analytical reasoning, application of mathematical tools, pattern finding, patience, determination, and luck. Cryptanalysts are also called attackers.

How does cryptography work?

A cryptographic algorithm, or cipher, is a mathematical function used in the encryption and decryption process. A cryptographic algorithm works in combination with a key—a word, number, or phrase—to encrypt the plaintext. The same plaintext encrypts to different ciphertext with different keys. The security of encrypted data is entirely dependent on two things: the strength of the cryptographic algorithm and the secrecy of the key. A cryptographic algorithm, plus all possible keys and all the protocols that make it work comprise a cryptosystem. PGP is a cryptosystem.

Public key cryptography is an asymmetric scheme that uses a pair of keys for encryption: a public key, which encrypts data, and a corresponding private, or secret key for decryption. You publish your public key to the world while keeping your private key secret. Anyone with a copy of your public key can then encrypt information that only you can read. Even people you have never met.

It is computationally infeasible to deduce the private key from the public key. Anyone who has a public key can encrypt information but cannot decrypt it. Only the person who has the corresponding private key can decrypt the information.

How does PGP work?

PGP combines some of the best features of both conventional and public key cryptography. PGP is a hybrid cryptosystem. When a user encrypts plaintext with PGP, PGP first compresses the plaintext. Data compression saves modem transmission time and disk space and, more importantly, strengthens cryptographic security. Most cryptanalysis techniques exploit patterns found in the plaintext to crack the cipher. Compression reduces these patterns in the plaintext, thereby greatly enhancing resistance to cryptanalysis. (Files that are too short to compress or which don't compress well aren't compressed.) PGP then creates a session key, which is a one-time-only secret key. This key is a random number generated from the random movements of your mouse and the keystrokes you type. This session key works with a very secure, fast conventional encryption algorithm to encrypt the plaintext; the result is ciphertext. Once the data is encrypted, the session key is then encrypted to the recipient's public key. This public key-encrypted session key is transmitted along with the ciphertext to the recipient.

See http://www.pgpi.org/doc/pgpintro/.

And PGP.

11
  • 1
    but, how are public and private key generated?? are they generated at the same time?? are they somehow related??(eg. they're related but it's not possible to deduce private one from public one) Jul 18, 2011 at 18:08
  • 2
    @DrStrangeLove: The keys are generated together; they are basically randomly-chosen numbers with special mathematical properties. It's not possible to deduce the private key from public one. Usually, the opposite (public from private) is impossible too. The Wikipedia articles on RSA, DSA and ECDSA have descriptions of each algorithm. Jul 18, 2011 at 18:13
  • 1
    @grawity: but in my example (on phrack) public key is represented with non-hex characters! What is this representation of the public key?? Jul 18, 2011 at 18:19
  • 2
    @DrStrangeLove: Often, blocks of binary data are encoded using Base64. OpenPGP keys use a slighly modified version called Radix64, described in the same page. Jul 18, 2011 at 18:21
  • 1
    @grawity: if i send encrypted message to Phrack, What garantees that their pgp software's very secure, fast conventional decryption algorithm will match mine likewise encryption algorithm??(i understood about the keys)Will it decrypt my message?? Jul 18, 2011 at 20:45
1

"PGP public key block" has complex format. Answered in https://stackoverflow.com/questions/27893569/what-is-a-pgp-secret-key

To see what is inside "PGP public key block" use:

gpg --list-packets keyfile | less

To see it in hex:

gpg --dearmor keyfile > keyfile.bin; hexdump -C keyfile.bin
1

This is an incredibly old thread, but I wanted to add a few details to the answer...

The pgp Public Key Block is the public key (in this case used by phrack.org). You would use this with your own pgp PRIVATE key to encrypt a message (or anything else) in a manner that only the owner of the PUBLIC key would be able to interpret. Many organizations publish a gpg PUBLIC key to facilitate bug reporting. For example, see https://services.google.com/corporate/publickey.txt

How to use it? I'll use gpg examples, because it is available on most platforms:

First you need your own key, if you don't already have one.

gpg --full-generate-key

This will start an interactive dialog to guide you through the process. Accept the defaults. You will also need to enter your name (or whatever you want to use as a name) and your email address (this really should be your actual email address). You also need to supply a passcode (remember this - if you forget it you won't be able to use your key!)

Next, import the PUBLIC key. Start by creating a file, phrack.txt, and paste the PUBLIC key from the website into the file. then,

gpg --import phrack.txt

The key will be imported and you will also see that the key belongs to a user called "[email protected]"

You can now encrypt your document. We will call the plaintext document "your_document.txt" and the encrypted document "your_document.gpg":

gpg --output your_document.gpg --encrypt --recipient [email protected] your_document.txt

You would send the encrypted document to the recipient. You should also send either your PUBLIC key, or a URL that contains your public key, so that they can encrypt their responses to you. Get your public key:

gpg --list-keys #will list all keys, note the fingerprint of your key
gpg --output PUBLIC.gpg --export --armor YOUR_KEY_FINGERPRINT
1
  • Everything below it makes sense, but I think you have 'PUBLIC' and 'PRIVATE' backward in the first paragraph, and a clearer example would be sending a bug to phrack.org: "You would use this PUBLIC key to encrypt a message that phrack.org (and only phrack.org) would be able to decrypt/interpret with their PRIVATE key."
    – jshrimp29
    Aug 10, 2023 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .