Re: Where to store private key

From: Michel Gallant (neutron_at_NOSPAMistar.ca)
Date: 02/25/04


Date: Tue, 24 Feb 2004 18:15:13 -0500


"David Hoffer" <dhoffer.remove@xrite.remove.com> wrote in message
news:OFWBx1x%23DHA.3220@TK2MSFTNGP10.phx.gbl...
> Could you clarify this...I am new to security APIs.
>
> I thought it was common to encrypt private keys using an asymmetric
> algorithm, i.e. public key encryption?

It is common to encrypt a symmetric secret (session) key with an asymmetric
public key encryption (e.g. this is used in most S/MIME encryption approaches).

The op was asking about protection of the asymmetric (e.g. RSA/DSA) private
key itself.
My first response showed the best way to let the OS protect it for you (which really
uses underlying symmetric key encryption based on user principal credentials.

For more portability, you can export your RSA public/private keypair and encrypt
it with a password derived symmetric key. In .NET you use PasswordDeriveBytes
class to generate cryptographically strong byte sequence for symmetric key generation.

Password derived symmetric keys basically just take the hash of the password and
the actual secret symmetric key is typically the first bytes of that hash (more complicated
procedure is 3DES is the derived key).

See also the paragraph "Key Maintenance | Protecting Exported Private Keys" here:
  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh07.asp

- Michel Gallant
   MVP Security
   http://www.jensign.com

> What do you mean by the "symmetric key is derived from some sort of a
> passphrase"?
>
> -dh
>
> "Derek Slager" <derek@activate.net> wrote in message
> news:pan.2004.01.22.18.58.12.535488@activate.net...
> > On Thu, 22 Jan 2004 18:48:20 +0530, Prasad wrote:
> >
> > > Hi:
> > >
> > > While using asymmetric algorithm, which is best place to store private
> > > key in client system in client-server applications.
> >
> > A common technique is to encrypt private keys using a symmetric algorithm.
> > Typically the symmetric key is derived from some sort of a passphrase.
> >
> > -Derek
> >
>
>



Relevant Pages

  • Re: Where to store private key
    ... There are, however, some known techniques which are ... However being quite new to security I still don't ... > Rijndael class to encrypt the data. ... >> uses underlying symmetric key encryption based on user principal ...
    (microsoft.public.dotnet.security)
  • Re: Basic question about RSA
    ... You "RSA Encrypt" padded data, ... message digest and sign the digest using her private key. ... the symmetric key. ...
    (sci.crypt)
  • Re: Encryption of messages between embedded system and PC?
    ... that will allow you to encrypt strings, ... No other party, not even the PC, can decrypt data ... The answer is "pieces of each frame ... frame using the symmetric cipher and the symmetric key of the cipher, ...
    (comp.arch.embedded)
  • Re: Java, MSCAPI interoperability - newbie
    ... A good solution (analogous to enveloped email) is to have the two parties have ... Then you can leverage RSA key-exchange protocol very easily. ... data with random symmetric key and encrypt the symmetric key with their local private RSA key ...
    (microsoft.public.platformsdk.security)
  • Re: RSA Encrypt/Decrypt Problems
    ... You can generate a snk for each and replicate the public key part to each ... Then sym encrypt your data with the key and iv and store in the ... You could actually do it with small blocks and only the public rsa key, ... > key) with the symmetric key embedded in the file and encrypted using the ...
    (microsoft.public.dotnet.security)