mirror of
https://github.com/cupcakearmy/occulto.git
synced 2024-10-31 22:04:11 +01:00
docs
This commit is contained in:
parent
0467a81797
commit
9a55148e32
@ -104,7 +104,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Hashes<span class="tsd-signature-symbol">:</span> <a href="../enums/_hash_.hashes.html" class="tsd-signature-type">Hashes</a><span class="tsd-signature-symbol"> = Hashes</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L16">Hash.ts:16</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L16">Hash.ts:16</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -121,7 +121,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L24">Hash.ts:24</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L24">Hash.ts:24</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
|
@ -104,7 +104,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L48">RSA.ts:48</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L48">RSA.ts:48</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
@ -131,7 +131,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L40">RSA.ts:40</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L40">RSA.ts:40</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
@ -158,7 +158,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L19">RSA.ts:19</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L19">RSA.ts:19</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
|
@ -107,7 +107,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Ciphers<span class="tsd-signature-symbol">:</span> <a href="../enums/_symmetric_.ciphers.html" class="tsd-signature-type">Ciphers</a><span class="tsd-signature-symbol"> = Ciphers</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L46">Symmetric.ts:46</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L46">Symmetric.ts:46</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -117,7 +117,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Encoding<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BufferEncoding</span><span class="tsd-signature-symbol"> = "base64"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L47">Symmetric.ts:47</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L47">Symmetric.ts:47</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -134,7 +134,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L94">Symmetric.ts:94</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L94">Symmetric.ts:94</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
@ -169,7 +169,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L56">Symmetric.ts:56</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L56">Symmetric.ts:56</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
@ -210,7 +210,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L113">Symmetric.ts:113</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L113">Symmetric.ts:113</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
|
@ -103,7 +103,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Util.ts#L5">Util.ts:5</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Util.ts#L5">Util.ts:5</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
@ -126,7 +126,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Util.ts#L4">Util.ts:4</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Util.ts#L4">Util.ts:4</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
|
@ -96,7 +96,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">MD5<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "md5"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L5">Hash.ts:5</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L5">Hash.ts:5</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -106,7 +106,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA1_<wbr>1<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha1"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L6">Hash.ts:6</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L6">Hash.ts:6</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -116,7 +116,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA1_<wbr>256<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha256"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L7">Hash.ts:7</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L7">Hash.ts:7</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -126,7 +126,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA1_<wbr>512<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha512"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L8">Hash.ts:8</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L8">Hash.ts:8</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -136,7 +136,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA3_<wbr>256<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha3-256"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L9">Hash.ts:9</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L9">Hash.ts:9</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -146,7 +146,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA3_<wbr>384<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha3-384"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L10">Hash.ts:10</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L10">Hash.ts:10</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -156,7 +156,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">SHA3_<wbr>512<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol"> = "sha3-512"</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Hash.ts#L11">Hash.ts:11</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Hash.ts#L11">Hash.ts:11</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
|
@ -96,7 +96,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>128_<wbr>CTR<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L24">Symmetric.ts:24</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L24">Symmetric.ts:24</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -106,7 +106,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>128_<wbr>GCM<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L21">Symmetric.ts:21</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L21">Symmetric.ts:21</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -116,7 +116,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>192_<wbr>CTR<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L23">Symmetric.ts:23</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L23">Symmetric.ts:23</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -126,7 +126,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>192_<wbr>GCM<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L20">Symmetric.ts:20</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L20">Symmetric.ts:20</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -136,7 +136,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>256_<wbr>CTR<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L22">Symmetric.ts:22</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L22">Symmetric.ts:22</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -146,7 +146,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">AES_<wbr>256_<wbr>GCM<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L19">Symmetric.ts:19</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L19">Symmetric.ts:19</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -156,7 +156,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Cha<wbr>Cha20<span class="tsd-signature-symbol">:</span> </div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L18">Symmetric.ts:18</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L18">Symmetric.ts:18</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
|
@ -68,75 +68,29 @@
|
||||
<p>High level wrapper around <a href="https://github.com/digitalbazaar/forge">forge</a>.</p>
|
||||
<p>Supports Hashes, Symmetric AES & ChaCha20 ciphers and Asymmetric RSA.</p>
|
||||
<p><strong>Typescript typings included</strong></p>
|
||||
<p><a href="https://cupcakearmy.github.io/occulto/index.html"><strong>📒 DOCS HERE 📒</strong></a></p>
|
||||
<h2 id="quickstart-">Quickstart 🚀</h2>
|
||||
<h6 id="install">Install</h6>
|
||||
<pre><code>npm i <span class="hljs-keyword">node</span><span class="hljs-title">-forge</span> occulto</code></pre><pre><code class="language-javascript"><span class="hljs-comment">// Whatever import you prefer</span>
|
||||
<span class="hljs-comment">// const { RSA } = require('occulto')</span>
|
||||
<span class="hljs-keyword">import</span> { RSA } <span class="hljs-keyword">from</span> <span class="hljs-string">'occulto'</span>
|
||||
<pre><code>npm i <span class="hljs-keyword">node</span><span class="hljs-title">-forge</span> occulto</code></pre><h3 id="examples">Examples</h3>
|
||||
<h2 id="rsa"><a href="https://cupcakearmy.github.io/occulto/modules/_rsa_.html">RSA</a></h2>
|
||||
<pre><code class="language-typescript"><span class="hljs-keyword">import</span> { RSA } <span class="hljs-keyword">from</span> <span class="hljs-string">'occulto'</span>
|
||||
|
||||
<span class="hljs-keyword">const</span> pair = <span class="hljs-keyword">await</span> RSA.gen()
|
||||
|
||||
<span class="hljs-keyword">const</span> encrypted = RSA.encrypt(<span class="hljs-string">'some string'</span>, <span class="hljs-string">'myPass'</span>)
|
||||
<span class="hljs-keyword">const</span> decrypted = RSA.decrypt(encrypted, <span class="hljs-string">'myPass'</span>)
|
||||
</code></pre>
|
||||
<h3 id="reference-">Reference 📒</h3>
|
||||
<h2 id="rsa">RSA</h2>
|
||||
<h4 id="rsa-gen-size-number-2-12-"><code>RSA.gen(size: number = 2 ** 12)</code></h4>
|
||||
<ul>
|
||||
<li>size: [optional, default=4096] Size of the RSA key</li>
|
||||
</ul>
|
||||
<h6 id="examples">Examples</h6>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> pair = <span class="hljs-keyword">await</span> RSA.gen() <span class="hljs-comment">// 4096-Bit</span>
|
||||
<span class="hljs-keyword">const</span> smallPair = <span class="hljs-keyword">await</span> RSA.gen(<span class="hljs-number">2</span>**<span class="hljs-number">10</span>) <span class="hljs-comment">// 1024-Bit</span></code></pre>
|
||||
<h4 id="rsa-encrypt-data-string-key-publickey-"><code>RSA.encrypt(data: string, key: PublicKey)</code></h4>
|
||||
<p>Encrypt message with public key</p>
|
||||
<h6 id="example">Example</h6>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> pair = <span class="hljs-keyword">await</span> RSA.gen()
|
||||
<span class="hljs-keyword">const</span> encrypted = RSA.encrypt(<span class="hljs-string">'some text'</span>, pair.pub)</code></pre>
|
||||
<h4 id="rsa-decrypt-data-string-key-privatekey-"><code>RSA.decrypt(data: string, key: PrivateKey)</code></h4>
|
||||
<p>Decrypts a message encrypted with <code>RSA.encrypt()</code> with the private key</p>
|
||||
<h6 id="example">Example</h6>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> pair = <span class="hljs-keyword">await</span> RSA.gen()
|
||||
<span class="hljs-keyword">const</span> encrypted = RSA.encrypt(<span class="hljs-string">'some text'</span>, pair.pub)
|
||||
<span class="hljs-keyword">const</span> decrypted = RSA.decrypt(encrypted, pair.prv)</code></pre>
|
||||
<h2 id="symmetric">Symmetric</h2>
|
||||
<h3 id="symmetric-ciphers"><code>Symmetric.Ciphers</code></h3>
|
||||
<p>Available ciphers</p>
|
||||
<ul>
|
||||
<li><code>Ciphers.ChaCha20</code></li>
|
||||
<li><code>Ciphers.AES_256_GCM</code></li>
|
||||
<li><code>Ciphers.AES_192_GCM</code></li>
|
||||
<li><code>Ciphers.AES_128_GCM</code></li>
|
||||
<li><code>Ciphers.AES_256_CTR</code></li>
|
||||
<li><code>Ciphers.AES_192_CTR</code></li>
|
||||
<li><code>Ciphers.AES_128_CTR</code></li>
|
||||
</ul>
|
||||
<h4 id="symmetric-encrypt-data-string-key-string-type-ciphers-ciphers-aes_256_gcm-"><code>Symmetric.encrypt(data: string, key: string, type: Ciphers = Ciphers.AES_256_GCM)</code></h4>
|
||||
<p>Encrypts a string.
|
||||
Defaults to <code>Ciphers.AES_256_CTR</code></p>
|
||||
<h6 id="examples">Examples</h6>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> encrypted = Symmetric.encrypt(<span class="hljs-string">'some string'</span> , <span class="hljs-string">'myPass'</span>)
|
||||
<h2 id="symmetric"><a href="https://cupcakearmy.github.io/occulto/modules/_symmetric_.html">Symmetric</a></h2>
|
||||
<p><a href="https://cupcakearmy.github.io/occulto/enums/_symmetric_.ciphers.html">Available Ciphers</a></p>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">import</span> { Symmetric } <span class="hljs-keyword">from</span> <span class="hljs-string">'occulto'</span>
|
||||
|
||||
<span class="hljs-keyword">const</span> e = Symmetric.encrypt(<span class="hljs-string">'some string'</span> , <span class="hljs-string">'myPass'</span>, Ciphers.AES_128_GCM)</code></pre>
|
||||
<h2 id="hash">Hash</h2>
|
||||
<h3 id="hash-hashes"><code>Hash.Hashes</code></h3>
|
||||
<p>Available hashes</p>
|
||||
<ul>
|
||||
<li><code>Hashes.MD5</code></li>
|
||||
<li><code>Hashes.SHA1_1</code></li>
|
||||
<li><code>Hashes.SHA1_256</code></li>
|
||||
<li><code>Hashes.SHA1_512</code></li>
|
||||
<li><code>Hashes.SHA3_256</code></li>
|
||||
<li><code>Hashes.SHA3_384</code></li>
|
||||
<li><code>Hashes.SHA3_512</code></li>
|
||||
</ul>
|
||||
<h4 id="hash-digest-s-string-type-hashes-hashes-sha3_256-"><code>Hash.digest(s: string, type: Hashes = Hashes.SHA3_256)</code></h4>
|
||||
<p>Calculates the hash of a string.
|
||||
Defaults to <code>Hashes.SHA3_256</code></p>
|
||||
<h6 id="examples">Examples</h6>
|
||||
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> hash = Hash.digest(<span class="hljs-string">'something'</span>)
|
||||
<span class="hljs-keyword">const</span> encrypted = Symmetric.encrypt(<span class="hljs-string">'some string'</span> , <span class="hljs-string">'myPass'</span>, Symmetric.Ciphers.AES_128_GCM)
|
||||
<span class="hljs-keyword">const</span> decrypted = Symmetric.decrypt(encrypted, <span class="hljs-string">'myPadd'</span>)</code></pre>
|
||||
<h2 id="hash"><a href="https://cupcakearmy.github.io/occulto/modules/_hash_.html">Hash</a></h2>
|
||||
<p><a href="https://cupcakearmy.github.io/occulto/enums/_hash_.hashes.html">Available hashes</a></p>
|
||||
<pre><code class="language-typescript"><span class="hljs-keyword">import</span> { Hash } <span class="hljs-keyword">from</span> <span class="hljs-string">'occulto'</span>
|
||||
|
||||
<span class="hljs-keyword">const</span> h = Hash.digest(<span class="hljs-string">'something'</span>, Hashes.MD5)
|
||||
<span class="hljs-keyword">const</span> hash = Hash.digest(<span class="hljs-string">'something'</span>)
|
||||
|
||||
<span class="hljs-keyword">const</span> h = Hash.digest(<span class="hljs-string">'something'</span>, Hash.Hashes.MD5)
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -90,7 +90,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Hash<span class="tsd-signature-symbol">:</span> <a href="../classes/_hash_.hash.html" class="tsd-signature-type">Hash</a><span class="tsd-signature-symbol"> = H</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/index.ts#L8">index.ts:8</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/index.ts#L8">index.ts:8</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -100,7 +100,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">RSA<span class="tsd-signature-symbol">:</span> <a href="../classes/_rsa_.rsa.html" class="tsd-signature-type">RSA</a><span class="tsd-signature-symbol"> = R</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/index.ts#L6">index.ts:6</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/index.ts#L6">index.ts:6</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -110,7 +110,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Symmetric<span class="tsd-signature-symbol">:</span> <a href="../classes/_symmetric_.symmetric.html" class="tsd-signature-type">Symmetric</a><span class="tsd-signature-symbol"> = S</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/index.ts#L7">index.ts:7</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/index.ts#L7">index.ts:7</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -120,7 +120,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Util<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol"> = U</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/index.ts#L9">index.ts:9</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/index.ts#L9">index.ts:9</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-type-declaration">
|
||||
|
@ -95,7 +95,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Key<wbr>Pair<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L6">RSA.ts:6</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L6">RSA.ts:6</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-type-declaration">
|
||||
@ -116,7 +116,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Private<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L3">RSA.ts:3</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L3">RSA.ts:3</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
@ -126,7 +126,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Public<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/RSA.ts#L4">RSA.ts:4</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/RSA.ts#L4">RSA.ts:4</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</section>
|
||||
|
@ -100,7 +100,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Cipher<wbr>Config<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L27">Symmetric.ts:27</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L27">Symmetric.ts:27</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-type-declaration">
|
||||
@ -127,7 +127,7 @@
|
||||
<div class="tsd-signature tsd-kind-icon">Encrypted<wbr>Item<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Symmetric.ts#L34">Symmetric.ts:34</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Symmetric.ts#L34">Symmetric.ts:34</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-type-declaration">
|
||||
|
@ -98,7 +98,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Util.ts#L14">Util.ts:14</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Util.ts#L14">Util.ts:14</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
@ -124,7 +124,7 @@
|
||||
<li class="tsd-description">
|
||||
<aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/e9ed8f0/src/Util.ts#L15">Util.ts:15</a></li>
|
||||
<li>Defined in <a href="https://github.com/CupCakeArmy/occulto/blob/0467a81/src/Util.ts#L15">Util.ts:15</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
|
Loading…
Reference in New Issue
Block a user