Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly are Delay signing and strong names in .net?

Tags:

I have seen in many article it is written that Delay signing and strong name for an assembly prevents it from hi-jacked.

What does that mean?

The only thing that i know is without a strong name you can not install an assembly in GAC. So suppose i have an assembly without a strong name, Can it be hi-jacked?

Someone please clarify my doubt.

like image 381
Deviprasad Das Avatar asked Dec 06 '11 01:12

Deviprasad Das


People also ask

What is strong name signing?

Strong naming refers to signing an assembly with a key, producing a strong-named assembly. When an assembly is strong-named, it creates a unique identity based on the name and assembly version number, and it can help prevent assembly conflicts.

What is strong name in VB net?

A Strong Key (also called SN Key or Strong Name) is used in the Microsoft . NET Framework to uniquely identify a component. This is done partly with Public-key cryptography. Strong keys or names provide security of reference from one component to another or from a root key to a component.

What is the need of delay signing the assemblies?

Delayed signing refers to a technique of partially signing assemblies while they are in the development phase. So, signing an assembly basically certifies that assembly by the manufacturer and prevents tampering and hi-jacking of that assembly.

What is strong name in C sharp?

A name that consists of an assembly's identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly.


1 Answers

There is plenty of information about this on MSDN; for example: Strong Naming, and Delay Signing

To summarize the basic idea:

Strong naming is a way of stamping your assembly with a simple identification mark, that can be used later to validate that it has not been modified since it was deployed. The strong name is basically a hash of the assembly's name, version, and a "strong-name key" unique to the developer. References to strong name assemblies go through stricter validation that reference to non-strongly-named ones; in particular, strong-named references must match version numbers, and the strong name hash must match.

This helps avoid two common sources of potential security vulnerabilities in your programs:

  1. A malicious user replaces an assembly in your program with a different assembly with the same file name, but which contains malicious code, and convinces your program to load and execute it.
  2. A malicious user replaces an assembly in your program with a different version of the same assembly, but which has known bugs that have since been fixed.

The strong name process will reject both of these actions because the strong name data will not match. This is why assemblies in the GAC must be strong named: they are uses so ubiquitously, they would otherwise make major targets for this kind of hijacking.

Note, however, that strong names do absolutely nothing to verify the identity of the publisher. Anyone can publish a strongly-named assembly claiming to be Microsoft and there's nothing in the strong name to refute that assertion. Verifying identify is the job of Authenticode digital signatures, which are different from strong naming. The two are often used together, but they are orthogonal concepts.

Delay signing is a technique for signing assemblies outside of the build process. The idea here is, your company might have policies that don't allow the strong name keys from being available at build time (perhaps they are kept offline, or secured behind a password.) A delay signed assembly is marked with a blank strong-name key: it basically reserves space for the key to be added later, by an authorized user. In the mean time, a partial strong-name key is included -- just enough information for other assemblies to make a strong reference, but not enough to detect changes or modifications.

like image 130
Michael Edenfield Avatar answered Nov 10 '22 13:11

Michael Edenfield