Assembly (CLI) - Assembly Names

Assembly Names

The name of an assembly consists of four parts

  1. The short name. On Windows this is the name of the Portable Executable (PE) file without the extension.
  2. The culture. This is an RFC 1766 identifier of the locale for the assembly. In general, library and process assemblies should be culture neutral; the culture should only be used for satellite assemblies.
  3. The version. This is a dotted number made up of four values — major, minor, build and revision.
  4. A public key token. This is a 64-bit hash of the public key that corresponds to the private key used to sign the assembly. A signed assembly is said to have a strong name.

The public key token is used to make the assembly name unique. Thus, two strong named assemblies can have the same PE file name and yet the CLI will recognize them as different assemblies. The Windows file system (FAT32 and NTFS) only recognizes the PE file name, so two assemblies with the same PE file name (but different culture, version or public key token) cannot exist in the same Windows folder. To solve this issue the CLI introduces the GAC (Global Assembly Cache) that is treated as a single folder by run-time, but is actually implemented using nested file system folders.

To prevent spoofing attacks, where a cracker would try to pass off an assembly appearing as something else, the assembly is signed with a private key. The developer of the intended assembly keeps the private key secret, so a cracker cannot have access to it nor simply guess it. Thus the cracker cannot make his assembly impersonate something else, lacking the possibility to sign it correctly after the change. Signing the assembly involves taking a hash of important parts of the assembly and then encrypting the hash with the private key. The signed hash is stored in the assembly along with the public key. The public key will decrypt the signed hash. When the CLR loads a strongly named assembly it will generate a hash from the assembly and then compare this with the decrypted hash. If the comparison succeeds then it means that the public key in the file (and hence the public key token) is associated with the private key used to sign the assembly. This will mean that the public key in the assembly is the public key of the assembly publisher and hence a spoofing attack is prevented.

Read more about this topic:  Assembly (CLI)

Famous quotes containing the words assembly and/or names:

    Had every Athenian citizen been a Socrates, every Athenian assembly would still have been a mob.
    James Madison (1751–1836)

    The world is a puzzling place today. All these banks sending us credit cards, with our names on them. Well, we didn’t order any credit cards! We don’t spend what we don’t have. So we just cut them in half and throw them out, just as soon as we open them in the mail. Imagine a bank sending credit cards to two ladies over a hundred years old! What are those folks thinking?
    Sarah Louise Delany (b. 1889)