# Class Password Namespace: [CapyKit](CapyKit.md) Assembly: CapyKit.dll Represents a password with its hash, salt and algorithm used for encryption. ```csharp public class Password ``` #### Inheritance [object](https://learn.microsoft.com/dotnet/api/system.object) ← [Password](CapyKit.Password.md) #### Inherited Members [object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), [object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), [object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) #### Extension Methods [ObjectExtensions.UpdateProperties\(Password, Password\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_\_1\_\_\_0\_\_\_0\_), [ObjectExtensions.UpdateProperties\(object, object\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_System\_Object\_System\_Object\_) ## Constructors ### Password\(string, byte\[\], IPasswordAlgorithm, params object\[\]\) Constructor. ```csharp public Password(string password, byte[] salt, IPasswordAlgorithm algorithm, params object[] args) ``` #### Parameters `password` [string](https://learn.microsoft.com/dotnet/api/system.string) The password to be hashed. `salt` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] The salt used for encryption. `algorithm` [IPasswordAlgorithm](CapyKit.IPasswordAlgorithm.md) The algorithm used for password encryption. `args` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] A variable-length parameters list containing arguments to include for the algorithm. ## Properties ### Algorithm Gets or sets the algorithm used for password encryption. ```csharp public IPasswordAlgorithm Algorithm { get; } ``` #### Property Value [IPasswordAlgorithm](CapyKit.IPasswordAlgorithm.md) ### Hash Gets or sets the hash of the password. ```csharp public byte[] Hash { get; } ``` #### Property Value [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] ### Pbkdf2Algorithm Gets the preconfigured PBKDF2 algorithm. ```csharp public static Pbkdf2Algorithm Pbkdf2Algorithm { get; } ``` #### Property Value [Pbkdf2Algorithm](CapyKit.Pbkdf2Algorithm.md) ### Salt Gets or sets the salt used for encryption. ```csharp public byte[] Salt { get; } ``` #### Property Value [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] ## Methods ### Equals\(object?\) Determines whether the specified object is equal to the current object. ```csharp public override bool Equals(object? obj) ``` #### Parameters `obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? The object to compare with the current object. #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) true if the specified object is equal to the current object; otherwise, false. ### ToString\(\) Returns a string that represents the current object. ```csharp public override string ToString() ``` #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) A string that represents the current object. ## Operators ### operator ==\(Password, Password\) ```csharp public static bool operator ==(Password a, Password b) ``` #### Parameters `a` [Password](CapyKit.Password.md) `b` [Password](CapyKit.Password.md) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### operator \!=\(Password, Password\) ```csharp public static bool operator !=(Password a, Password b) ``` #### Parameters `a` [Password](CapyKit.Password.md) `b` [Password](CapyKit.Password.md) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean)