Decrypt but not Encrypt
-
Hey, Does anyone know of a way in .NET (C#) to use a key that will decrypt a something but not encrypt it. I looked at RSA,DSA, and TripleDES but when getting the private key it includes the public key as well. Does anyone know if this is possible or would I need to rethink my design. Thanks -- John
-
Hey, Does anyone know of a way in .NET (C#) to use a key that will decrypt a something but not encrypt it. I looked at RSA,DSA, and TripleDES but when getting the private key it includes the public key as well. Does anyone know if this is possible or would I need to rethink my design. Thanks -- John
John, I belive RSA is what your looking for. The basic idea is use the public key to encrypt the private key to decrypt. You can get the RSA class to export the key pair without the private key. Hope this helps ~Nick
Forever Developing
-
Hey, Does anyone know of a way in .NET (C#) to use a key that will decrypt a something but not encrypt it. I looked at RSA,DSA, and TripleDES but when getting the private key it includes the public key as well. Does anyone know if this is possible or would I need to rethink my design. Thanks -- John
Look at wiki Mainly, you are concerned about the difference between Symmetric-key cryptography and Public-key cryptography. From your post, it seems like you need Public-key cryptography but there is a catch! Public-key by itself cannot encrypt large messages. Public-key crypto is usually used for setting up a shared key or digital signatures(DSA). In shared key, one encrypts the key using a Public-key crypto(RSA,ECC,...) and sends it to the other party. The other party decrypts the key and then both parties switch to a Symmetric cipher for future transmissions. (There is also diffie-hellman key exchanges as well). In a DSA (roughly), you encrypt the hash of your message. It might help if you explain in more detail what you are trying to do.
-
Look at wiki Mainly, you are concerned about the difference between Symmetric-key cryptography and Public-key cryptography. From your post, it seems like you need Public-key cryptography but there is a catch! Public-key by itself cannot encrypt large messages. Public-key crypto is usually used for setting up a shared key or digital signatures(DSA). In shared key, one encrypts the key using a Public-key crypto(RSA,ECC,...) and sends it to the other party. The other party decrypts the key and then both parties switch to a Symmetric cipher for future transmissions. (There is also diffie-hellman key exchanges as well). In a DSA (roughly), you encrypt the hash of your message. It might help if you explain in more detail what you are trying to do.
-
I'm looking at encrypting a small XML file which will contain settings. Now I want the file to be unencrypted so it's readable but not the ability to encrypt a new XML file to replace it. Cheers -- John
-
Ah, you need a digital signature. http://en.wikipedia.org/wiki/Digital_signature Google has alot under c# digital signature
-
Hi! You could sign a hash value of your data (private key required for that) and verify the integrity of the hash using just the public key. For this you only have to include the public key into your app and keep the private key safe.
Regards, mav -- Black holes are the places where God divided by 0...