> For the complete documentation index, see [llms.txt](https://codeline.gitbook.io/password-locking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codeline.gitbook.io/password-locking/quick-start.md).

# Quick Start

{% hint style="info" %}
**Good to know:** With the new update, the algorithm has completely changed. Encrypted texts prior to version 2.0.0 cannot be used in versions later than 2.0.0. Install password-locking\@1.3.3 to use old version.
{% endhint %}

## Install the library

{% tabs %}
{% tab title="Node" %}

```
npm i password-locking
```

{% endtab %}
{% endtabs %}

## Make your first code

We are encrypting a text using the <mark style="color:green;">**def1 algorithm**</mark> in this code block. This algorithm type will be the only one used in all versions. The biggest feature of this algorithm is that you don't need to specify whether you want to encrypt a plain text or decrypt an encrypted text. The system automatically detects and responds accordingly. If you examine the examples, the code in the <mark style="color:orange;">encrypt</mark> block <mark style="color:yellow;">Password 123456789 (-\_-)(^-^)</mark> will encrypt the text for you, and if you look at the <mark style="color:orange;">decoding</mark> block, it will convert the text we encrypted in the 'encrypt' block back to its original form. Remember that we use salting technique in encryption, so you will encounter a different text each time you encrypt a message

{% tabs %}
{% tab title="encrypt" %}

```javascript
const pl = require("password-locking");

let encrypted  = pl.encryption.def1({
text:"Password 123456789 (-_-)(^-^)"
});
```

{% endtab %}

{% tab title="decoding" %}

```javascript
const pl = require("password-locking");

let decrypt  = pl.encryption.def1({
text:"^/+/!-/-*?##!+-?!&^/+*/-!!+%&+^/+=)(^/+__!^/+/£)^/+'*?+%^#½$^/+==&"
});
```

{% endtab %}
{% endtabs %}

## FAQ / SSS

<details>

<summary>Does it have only one algorithm ?</summary>

As of now, we only have the <mark style="color:green;">def1 algorithm</mark>, but new updates will introduce new algorithms. Additionally, the algorithm we are currently working on allows you to specify your own parameters and create a personalized encryption algorithm, enabling you to perform even more secure encryption.

</details>

<details>

<summary>Is it safe ?</summary>

As of now, <mark style="color:orange;">I cannot give you a 100% guarantee</mark>, but this algorithm is more secure on short data. If the encrypted data is stored in a database for a long time and is detected by an attacker, it can be decrypted. Therefore, this algorithm is more suitable for <mark style="color:green;">short data</mark> such as one-time verification codes, texts or passwords that change every 5 minutes, for example.

</details>
