How is the public key used for decryption in .NET assemblies?

Configured .NET assemblies contain a public key, but the public key is used for encryption in RSA, and then how does .NET use the public key to decrypt signed assemblies?

Well, signed assemblies contain a hash, but the hash is encrypted using the private key, not the public key. So, why and how in private keys. NET are used for encryption and public keys for decryption. I mean, all software, such as RSACryptoPad, uses the public key for encryption, not decryption.

+4
source share
3 answers

The public and private key pair is not used to encrypt the entire assembly. Instead, it is used to sign assembly.

Simplifying the simplification is to sign the file - for example, an assembly - you take the hash of the file, and then end this hash with your private key. Someone using the file verifies your signature by creating a hash of the file itself and then decrypting your encrypted hash with your public key, and confirming these two hashes is the same. This proves two things:

  • The assembly comes from the one who claims to be because of you - since it was created with your private key.
  • The assembly was not changed by someone else, because the hash that you made when you released the assembly is the same as the current one. No one can change the signed assembly, as they will also have to make the appropriate changes to the encrypted hash that requires your private key.

For more information on digital signatures, see this Wikipedia article .

The great thing about the public and private key parses is that they work anyway. Thus, something encrypted with your private key can only be decrypted with your public key, but something encrypted with your public key can be decrypted with your private key. The latter use means that if someone wants to send something to you and only you, then you can encrypt it with your freely available public key, but they know that only you with your private key can decrypt it.

Since the keys work only in pairs, and the encryption is asymmetric - someone else can’t just cancel the public key encryption that he does to receive a message for you.

+6
source

The idea is that the signature can only be created using the private key, but after that anyone who has a copy of the public key can verify the signature. Decryption is not required for the signature - the signature is simply added to the assembly of the plain text.

+3
source

The purpose of signing assemblies is to verify their source. If I sign my meeting, then send it to you, you must be sure that it comes from me, and it was not faked along the way.

+1
source

All Articles