Re: PGP scripting...

From: John Viega (viega@list.org)
Date: 01/09/03

  • Next message: dirk.dussart@pwc.be: "Re: Standards for developing secure software"
    Date: Wed, 8 Jan 2003 21:08:15 -0500
    To: Valdis.Kletnieks@vt.edu
    From: John Viega <viega@list.org>
    
    

    I've skipped most of this thread, so I'm not 100% sure of the context.
    It looks like you're talking about how RSA works. Note that the RSA
    public key consists of the modulus and the public exponent. The
    modulus is the product of two primes. When someone refers to a
    1024-bit "RSA key", they generally mean that the size of the modulus is
    1024 bits, meaning that there are two secret primes that are generally
    512 bits each.

    Private keys should generally be encrypted on disk, if at all possible,
    in order to avoid disastrous consequences on break-in. Generally, it's
    represented in a DER-encoded format, then encrypted with a key that is
    derived through a password-based key derivation function (see PKCS#5).
    It is often then PEM encoded, which is more or less base-64 encoding,
    though how to PEM-encode password-encrypted data is not really
    something anyone agrees upon.

    John

    On Wednesday, January 8, 2003, at 06:00 PM, Valdis.Kletnieks@vt.edu
    wrote:

    > On Wed, 08 Jan 2003 09:26:04 -1000, Jason Coombs said:
    >> Aloha,
    >>
    >> The public key is derived from the private key. Anyone in possession
    >> of the
    >> private key is by definition also in possession of the public key.
    >> The same
    >> is not true in reverse, a party can possess the public key without the
    >> ability to (reasonably) discover the matching private key.
    >
    > Actually, it's quite possible for the same private key to match with
    > two
    > or more different public keys. So for instance, you could have:
    >
    > public, private = 37, 13
    > public, private = 53, 13
    >
    > These are of course 2 different key *PAIRS*.
    >
    > What you may be misunderstanding is that the key *pair* is derived
    > from one
    > number, which is usually the product of two primes. I'd have to do a
    > quick
    > UTSL, but I believe that in addition to the "private" key, PGP also
    > stores
    > enough other info (like the modulus used, etc) to allow regenerating
    > the public
    > key, and anybody who compromises the system gets *all* the different
    > data items
    > saved. But strictly speaking, having the private key *only* doesn't
    > get you
    > the public key...
    >
    > Schneier's "Applied Cryptography" has a good chapter on RSA that
    > explains how
    > this all works...
    > --
    > Valdis Kletnieks
    > Computer Systems Senior Engineer
    > Virginia Tech
    >
    > <mime-attachment>



    Relevant Pages

    • Re: Strength of RSA with known plain-text.
      ... RSA is NEVER used to encrypt plain text. ... No public key system is used ... RSA is only used in the following 2 ways. ... Using your private key to encrypt the 160-bit SHA-1 hash of your ...
      (sci.crypt)
    • Re: RSA .crt and .key file formats?
      ... > and private key file (actually, the private key file, from what I can ... Basically, for RSA signatures, and for RSA decryption, you need to ... needs only the modulus n and the private exponent d. ... setting is to choose a random binary value K, encrypt it ...
      (sci.crypt)
    • Re: How to use RSACryptoServiceProvider?
      ... RSA can be encrypted by any key of the pair then can be decrpted ... the plain text was encrypted by private key and I wanna ... > it the public key but not the private key. ... > RSACryptoServiceProvider will be able to encrypt but not decrypt. ...
      (microsoft.public.dotnet.security)
    • Re: Encrypt with Private key, Decrypt with Public Key (RSACryptoServiceProvider)
      ... > license key with a private key and to decrypt this license key with ... >> Why would you take out the public key? ... >> This is what RSA does for digital signatures. ...
      (microsoft.public.dotnet.security)
    • Re: Verification
      ... > The processor doesn't have a chance of doing any kind of public private key ... > encryption ... > using an RSA public key allowing the device to tell it's session key (if you ...
      (sci.crypt)