CapyKit/Docs/_site/api/CapyKit.IPasswordAlgorithm.html

268 lines
8.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Interface IPasswordAlgorithm | CapyKit Documentation </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Interface IPasswordAlgorithm | CapyKit Documentation ">
<meta name="description" content="Defines the contract for password encryption algorithms.">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="../toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="CapyKit Documentation">
CapyKit Documentation
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="content">
<div class="actionbar">
<nav id="breadcrumb"></nav>
</div>
<article data-uid="CapyKit.IPasswordAlgorithm">
<h1 id="CapyKit_IPasswordAlgorithm" data-uid="CapyKit.IPasswordAlgorithm" class="text-break">
Interface IPasswordAlgorithm
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="CapyKit.html">CapyKit</a></dd></dl>
<dl><dt>Assembly</dt><dd>CapyKit.dll</dd></dl>
</div>
<div class="markdown summary"><p>Defines the contract for password encryption algorithms.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public interface IPasswordAlgorithm</code></pre>
</div>
<dl class="typelist extensionMethods">
<dt>Extension Methods</dt>
<dd>
<div>
<a class="xref" href="CapyKit.Extensions.ObjectExtensions.html#CapyKit_Extensions_ObjectExtensions_UpdateProperties__1___0___0_">ObjectExtensions.UpdateProperties&lt;T&gt;(T, T)</a>
</div>
<div>
<a class="xref" href="CapyKit.Extensions.ObjectExtensions.html#CapyKit_Extensions_ObjectExtensions_UpdateProperties_System_Object_System_Object_">ObjectExtensions.UpdateProperties(object, object)</a>
</div>
</dd></dl>
<h2 class="section" id="properties">Properties
</h2>
<a id="CapyKit_IPasswordAlgorithm_AlgorithmName_" data-uid="CapyKit.IPasswordAlgorithm.AlgorithmName*"></a>
<h3 id="CapyKit_IPasswordAlgorithm_AlgorithmName" data-uid="CapyKit.IPasswordAlgorithm.AlgorithmName">
AlgorithmName
</h3>
<div class="markdown level1 summary"><p>Gets the name of the algorithm.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">string AlgorithmName { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="CapyKit_IPasswordAlgorithm_Compare_" data-uid="CapyKit.IPasswordAlgorithm.Compare*"></a>
<h3 id="CapyKit_IPasswordAlgorithm_Compare_System_String_System_Byte___System_Object___" data-uid="CapyKit.IPasswordAlgorithm.Compare(System.String,System.Byte[],System.Object[])">
Compare(string, byte[], params object[])
</h3>
<div class="markdown level1 summary"><p>Compares the given plaintext password with an encrypted value using PBKDF2 algorithm.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">bool Compare(string password, byte[] encryptedValue, params object[] args)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>password</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The plaintext password to compare.</p>
</dd>
<dt><code>encryptedValue</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
<dd><p>The encrypted value to compare against.</p>
</dd>
<dt><code>args</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>[]</dt>
<dd><p>Additional arguments for the encryption process, such as salt and length.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the given <code class="paramref">password</code> matches the <code class="paramref">encryptedValue</code>,
false if they are different.</p>
</dd>
</dl>
<a id="CapyKit_IPasswordAlgorithm_Encrypt_" data-uid="CapyKit.IPasswordAlgorithm.Encrypt*"></a>
<h3 id="CapyKit_IPasswordAlgorithm_Encrypt_System_String_System_Object___" data-uid="CapyKit.IPasswordAlgorithm.Encrypt(System.String,System.Object[])">
Encrypt(string, params object[])
</h3>
<div class="markdown level1 summary"><p>Encrypts the given password using a defined algorithm.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">byte[] Encrypt(string password, params object[] args)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>password</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The plaintext password.</p>
</dd>
<dt><code>args</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>[]</dt>
<dd><p>Additional arguments for the encryption process, such as salt and length.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
<dd><p>A byte array with the hashed <code class="paramref">password</code>.</p>
</dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
</div>
</div>
</footer>
</body>
</html>