Export (0) Print
Expand All
Expand Minimize

FormsAuthPasswordFormat Enumeration

Defines the encryption format for storing passwords.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public enum FormsAuthPasswordFormat

Member nameDescription
ClearSpecifies that passwords are not encrypted. This field is constant.
MD5Specifies that passwords are encrypted using the MD5 hash algorithm. This field is constant.
SHA1Specifies that passwords are encrypted using the SHA1 hash algorithm. This field is constant.

To programmatically configure the type of encryption used to store passwords in a Web application, use the AuthenticationSection class. This class is also used internally by FormsAuthentication in the processing of authentication tickets.

The following code example shows how to use the FormsAuthPasswordFormat enumeration. Refer to the code example in the FormsAuthenticationUserCollection class topic to learn how to get the collection.

            // Get the current PasswordFormat property value.
            FormsAuthPasswordFormat currentPasswordFormat =
            formsAuthenticationCredentials.PasswordFormat;


            // Set the PasswordFormat property value.
            formsAuthenticationCredentials.PasswordFormat = 
                FormsAuthPasswordFormat.SHA1;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft