RE: RSACrypto.. - can I reuse the private key and more..?

From: Eric Dan (nospam_at_stopspamming.com)
Date: 08/16/05


Date: Tue, 16 Aug 2005 07:02:01 -0700

Some more answers to myself :-)

I have found a way to import a key to another machine using the
RSACryptoServiceProvide.
However it does not work with keys created by the sn.exe tool, there is an
exception when trying to decrypt/export such keys - any idea why?

steps:
- Create a new key in a named container (cspparameters)
- Export to xml (public + private)
- Go to the other machine
-Create RSACryptoServiceProvide with the same params for the CSP as above
-Call rsa...fromXml (use the output xml created above)
- rsa... PersistKey ..
- And it works - now the 2 machines use the same private key

-- 
Thanks
Eric
"Eric Dan" wrote:
> 
> Using the default constructor of RSACryptoServiceProvider - it creates a new 
> pair of keys - public + private.
> 
> 1) Is there a way to reinstall the private key on another machine? (I know 
> that I can export the private key, but can I force the class to reinstall it 
> using the exported data?
> 
> 2) Is it possible to encrypt/decrypt using a key pair created by sn.exe 
> tool? (is there a deterministic way to know the actual key index ? I also 
> realized that there is also a problem when trying to decrypt with a private 
> key created by sn tool - an exception occurs  - I have used thr right 
> container name and tried to decrypt info which has been encrypted with the 
> public key)
> 
> 3) Is there a centrilized location for answering all these questions?
> 
> 
> -- 
> Thanks in advance
> Eric


Relevant Pages

  • RE: Decryption using private key from cert store failing with err
    ... The reason we need to do a decrypt/encryptis that that is ... It decrypts with the private key and then the ... The other libraries encrypt/decrypt calls do not ... > invalid cryptograph to decrypt, otherwise we will get invalid data ...
    (microsoft.public.platformsdk.security)
  • Re: Whats the safest way to store password?
    ... But the data that I need to encrypt/decrypt ... password, the hash value of the original data dose not help, I need to ... You can use two keys, one to encrypt the data, the private key and one to ... decrypt the data the public key. ...
    (borland.public.delphi.thirdpartytools.general)
  • NTFS Encryption
    ... encrypt/decrypt the file. ... the certificate manager (run mmc.exe and open ... have the private key for the certificate. ... have this you can't decrypt. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: CryptAPI(encryption/decryption)
    ... It seems like you're missing the Base64 decode step when trying to decrypt ... I misspelled the Private Key as Primary Key. ... Is there any variation in the encryption format in openssl compared to ... "Dylan DSilva " wrote: ...
    (microsoft.public.pocketpc.developer)
  • [OT] Re: Basic question about Public Private Key Pairs
    ... > and private keys allow me to decrypt, but vice versa is not possible (or ... a public key and a corresponding private key. ... You can encrypt something with each key; ...
    (microsoft.public.dotnet.security)

Loading