1

Can I encrypt using private key and decrypt with the public key ?

I found My answer: Asymmetric Encryption

I just did not Pay attention about the fact that the public key is public :D

Community
  • 1
  • 1
muhammadelmogy
  • 153
  • 2
  • 9
  • RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. http://en.wikipedia.org/wiki/RSA – Bartzilla Feb 15 '11 at 09:47

2 Answers2

0

You can encrypt whit private key, but in that case anyone whit public key can decrypt and this way it is meaningless to use such scheme.

Other party should send you his public key and then you encrypt with their public key and other party decrypt with their own private key.

For key exchange use protocol called Diffie Hellman. Public key is used mostly for authentication only.

Daniel
  • 3,741
  • 1
  • 16
  • 21
Luka Rahne
  • 10,336
  • 3
  • 34
  • 56
-1

You must use public key to encryption and private key to decription - it's point of RSA cryptography.

You can provide public key in some public place - then everybody can encrypt data and send you, but only you, with your private key can decrypt this message. You can use http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.aspx

more info: http://en.wikipedia.org/wiki/Public-key_cryptography#How_it_works http://en.wikipedia.org/wiki/File:Public_key_encryption.svg

Saint
  • 5,397
  • 22
  • 63
  • 107
  • must is an strong word to use. Digital signatures work the exact opposite way, and since microsoft decided to implement their hash and sign in the signature method, you are locked down from creating your own hash routine. – fpmoles Sep 07 '16 at 15:57