Why should sign the DLL

This link: Link .
@ (Why should DLL is signed)

Once in a project, it requires you to create a strong name for the DLL, and create a strong name for a project, and then compile the project solutions began to appear strange compile errors. I have been to many times. The face of these problems, I have some doubts surfaced.

Basic understanding

Let us read the following carefully the basics. We will investigate the following

  1.   组装
  2.   加密
  3.   散列
  4.   数字签名

Assembly:
Assembly is used to deploy the compiled code base, security, and version control. EXE and DLL are different types of assemblies. It consists of the name, culture, version, and public key token.
Encryption using the encryption algorithm as a process to convert the information unreadable, and only use the specific information will be unreadable called key information into a readable format. They are of two types
a) symmetric cryptography
b) asymmetric cryptography
let us focus only on asymmetric cryptography, symmetric cryptography is flat because of direct password.

The use of a pair of public key and private key called asymmetric cryptography provides a very secure mechanism to encrypt and decrypt data.

    **私钥绝不应传递给另一个实体。与公钥相反,它应该被传递。**

And is locked by a private entity security holders. Never pass it to another entity. The public key is the opposite; you can provide public key to anyone who requested it.

Let's consider an analogy, Gates and Steve want to communicate with each other. They chose an asymmetrical way. Gates of digital transmission with automatic padlock to open the box. The digital padlock can be automatically shut down, but the need to turn the key.

    **开箱=公钥 数字挂锁键=私钥**

Open the box is considered to be aware of everyone's public key. Steve placed automatically open and close the message number padlock housing. Here, for the key to open the box is the private key.

Hash:
If you change the data after the data into the frame (even frame and content), how to do. To avoid data before encryption or after the change, we use a process called hashing. Cryptographic hash function gets the data blocks of any size, and returns a fixed-size binary data, called the hash value. If you change the original data block in any way, the calculated hash value will also change. If the original data bit is changed, there are at least 50%-bit computing a hash value of the change. If the data does not change, and you repeatedly compute the hash value, the hash value will be the same. If the copy data and calculates its hash value, it will be the same.

Digital signature:
digital signature can prove that the message has not been modified, and can prove the identity of its author.

     **非对称加密和哈希的结合**

This is a combination of two essential themes of this topic has been covered: using the private key of an asymmetric encryption and hashing. By computing a hash value, and then using a dedicated asymmetric cryptographic key to encrypt the hash value, digital signature can be created.
Deep Dive is over, let's get back to the surface discuss our true purpose.

What is a strong name?

Strong name is a unique technique for identifying assembly. It consists of name, version number, culture, and public key token and digital signature.

What is the significance strong name is?

Strong name solves two purposes. 1. 2. version control authentication.
Version control to solve the problem known as "DLL Hell" is. Since the technology uniquely identifies the assembly, so that the same name may exist in the DLL files with different versions of the same number of clips (GAC) in the.
Authentication, we want to ensure that they become the source code for the procedure. Since we signed the assembly since, to solve this problem, which solves the authentication problem.

Why do we need strong name? Are all DLL will need to create a strong name?

As we discussed, the purpose of solving the strong name version control and authentication, strong name signatures shared or public assemblies can be published in the GAC (Global Assembly Cache). Anyone using our assemblies can be sure that they are using the correct version and assembly, while the external version does not modify this.
Strong name signature applies only to shared or public gatherings
strong name signatures apply only to shared or public meeting. If you only use the program sets its own executable file, you do not need to sign the assembly with a strong name.

How to use a strong name in the real-time situation

The compiler will signed assemblies stored in the full name of the program it was created with focus
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/wangzhe66369/p/11672554.html