Share via


PassportIdentity.Encrypt

PassportIdentity.Encrypt

Encrypts data using the same key that is used to exchange Microsoft .NET Passport information sent to the .NET Passport network.

Syntax

public static string Encrypt( string strData )

Parameters

  • strData
    The data to be encrypted.

Return values

Data encrypted using the key for the current site.

Example

For an example of this method, see PassportIdentity.Decrypt.

Remarks

After the Encrypt method is executed, the Decrypt method must be used to make the data readable. Encrypt will fail if attempting to encrypt a null or more than 2045 bytes of information. Larger blobs of data must be broken up and encrypted separately. The Encrypt and Decrypt methods are used to help maintain the data's security.

Use the Encrypt method to encrypt data sent over the Internet or stored in a cookie.

Typically, this method is used in conjunction with the Decrypt, Compress, and Decompress methods.

See Also

Passport PassportIdentity Object | PassportIdentity.Compress | PassportIdentity.Decompress