Is it possible to encrypt with private key using .net RSACryptoServiceProvider?

前端 未结 9 1975
醉话见心
醉话见心 2020-12-08 05:32

I know that RSACryptoServiceProvider can encrypt with the public key, then it can be decrypted with the private key.

Is it possible to encrypt with the private key a

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 06:00

    This is what I understand RSA signature.

    pseudo code:

    First Alice made a signature:

    alice_signature = encrypt(alice_message, alice_private_key)
    

    Then Bob Eve... (anyone who having alice_public_key) verify the signature:

    decrypted_message = decrypt(alice_signature, alice_public_key)
    

    To confirm:

    if(received_message_from_alice == decrypted_message)
      the signature proved the message is from alice
    

提交回复
热议问题