SecureComparison.Equals Method

CryptSharp

SecureComparisonEquals Method CryptSharp
Compares two strings in a timing-insensitive manner.

Namespace: CryptSharp.Utility
Assembly: CryptSharp (in CryptSharp.dll) Version: 2.1.0.0
Syntax

public static bool Equals(
	string potentialAttackerSuppliedString,
	string referenceString
)
Public Shared Function Equals ( 
	potentialAttackerSuppliedString As String,
	referenceString As String
) As Boolean
public:
static bool Equals(
	String^ potentialAttackerSuppliedString, 
	String^ referenceString
)
static member Equals : 
        potentialAttackerSuppliedString : string * 
        referenceString : string -> bool 

Parameters

potentialAttackerSuppliedString
Type: SystemString
The string controlled by a potential attacker.
referenceString
Type: SystemString
The string not controlled by a potential attacker.

Return Value

Type: Boolean
true if the strings are equal.
Remarks

If the reference string is zero-length, this method does not protect it against timing attacks. If the reference string is extremely long, memory caching effects may reveal that fact.
See Also

Reference