Share via


Designing for Algorithm Abstraction

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

With the Cryptography Application Block, developers can refer to the algorithm to be used by the various methods by using logical names, such as "hash provider" or "password encryption."

Design Implications

The abstraction of the algorithm by logical naming implies two things about the application block's design:

  • API support for logical names
  • Dependency on the Enterprise Library Core

API Support for Logical Names

Each Cryptographer method accepts a string containing a logical algorithm name. The object uses this logical name to locate the appropriate algorithm information within the configuration file.

Dependency on Configuration

Because algorithm information is in a configuration file, the Cryptography Application Block must be able to read configuration information. As a result, the Cryptographer class requires the Enterprise Library Core and uses it to locate and read the necessary information from the configuration file.