Re: How to encrypt/decrypt a file



"Eric Johnson" <ej@xxxxxxxxxxxxxxxxx> wrote in message
news:qFJIf.22845$6Q3.17878@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm new to this to, in fact I just got done with my first real use of encryption and it doesn't
sound too different from what you are running into. Here's a little about what I ended up doing,
hopefully it'll help.

I created a public/private key pair (RSACryptoServiceProvider) that gets stored in a Key Container
on the server. The client is given the public key so they can decrypt stuff the server encrypted
with its private key.


The public key should be considered exactly that .. PUBLIC ..
If you are expecting that the data is ENCRYPTED with the servers private
key, then this is poor security.
What you are doing (encrypting with servers private key .. decrypting with
corresponding public key on the client) is what digital siganture verification is about.
Public keys should be considered complely visible publically .. therefore, the
encryption scheme you are using is not sure at all (even though you might think
you are protecting the public key for your clients use only?)

- Mitch Gallant
MVP Security


.



Relevant Pages

  • Re: General PKI Question
    ... > using your public key, and decrypt it with his own private key. ... Signing = encrypting with private key, ...
    (microsoft.public.security)
  • Re: very basic quextions: public key encryption
    ... you're talking about signing rather than encrypting. ... with his private key, and you use his public key to verify it. ... everyone has the same public key for the sender. ...
    (comp.security.ssh)
  • Re: Encrypt with Private key, Decrypt with Public Key (RSACryptoServiceProvider)
    ... Encryption with an RSA private key is mainly used for generating ... and then send it to someone so they can verify (with your public key, ... > portion/public portion, mainly because I AM CURIOUS AND I WONT GIVE MY ... > public portion of the key if I am encrypting with the private portion. ...
    (microsoft.public.dotnet.security)
  • Re: More CryptImportKey/NTE_BAD_KEY issues
    ... > generate and maintain a selection of keys to be kept within our own keystore ... > for encrypting this data. ... >> key is apparently a public key that correspond to private key stored on ... >> computer A in a key container that you are opening with CryptAcquireContext ...
    (microsoft.public.platformsdk.security)
  • I cant able to decrypt the encrypted data. Displays Bad Data Error.
    ... Dim oRSA As New System.Security.Cryptography.RSACryptoServiceProvider ... I am getting public key and private key and displaying them in text boxes. ... i am assinging public key and encrypting the ...
    (microsoft.public.dotnet.security)