MembershipProvider.EncryptPassword Method

Encrypts a password.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

protected virtual byte[] EncryptPassword (
	byte[] password
protected byte[] EncryptPassword (
	byte[] password
protected function EncryptPassword (
	password : byte[]
) : byte[]
Not applicable.



A byte array that contains the password to encrypt.

Return Value

A byte array that contains the encrypted password.

Exception typeCondition


The ValidationKey property or DecryptionKey property is set to AutoGenerate.

The EncryptPassword method is a virtual method that is provided for membership provider implementations to use when supporting encrypted password formats.

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions