Compares two strings in a timing-insensitive manner.
Namespace: CryptSharp.UtilityAssembly: CryptSharp (in CryptSharp.dll) Version: 2.0.0.0
public static bool Equals(
string potentialAttackerSuppliedString,
string referenceString
)
public static bool Equals(
string potentialAttackerSuppliedString,
string referenceString
)
Public Shared Function Equals ( _
potentialAttackerSuppliedString As String, _
referenceString As String _
) As Boolean
Public Shared Function Equals ( _
potentialAttackerSuppliedString As String, _
referenceString As String _
) As Boolean
public:
static bool Equals(
String^ potentialAttackerSuppliedString,
String^ referenceString
)
public:
static bool Equals(
String^ potentialAttackerSuppliedString,
String^ referenceString
)
static member Equals :
potentialAttackerSuppliedString : string *
referenceString : string -> bool
static member Equals :
potentialAttackerSuppliedString : string *
referenceString : string -> bool
Parameters
- potentialAttackerSuppliedString
- Type: System String
The string controlled by a potential attacker.
- referenceString
- Type: System String
The string not controlled by a potential attacker.
Return Value
true if the strings are equal.
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.