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

# DarkRP\_Encrypt

## [Buy on Store](https://darkrpth.tebex.io/package/6472198)

{% embed url="<https://www.youtube.com/watch?v=NgWq2A2Zw_I>" %}

Protect your whole script source code from hacker script dumper.\
Encrypt whole **.lua** and **.js** files in one click.

> If you have many script folder many sub folder don't worry, just push whole script folder into tool folder then run **start.cmd**

## How To Use

1. Install [Node.js](https://nodejs.org/) on your machine.
2. Drop your all script into **DarkRP\_Encrypt/cfx-server-data/** folder
3. Run **start.cmd**
4. Now all **.lua** and **.js** are encrypted
5. Push encrypted scripts to your live server

{% hint style="info" %}
Don't forget to backup your original scripts
{% endhint %}

## Config

Edit in **DarkRP\_Encrypt/src/index.js**

```javascript
let elKey = "g4dHxF7MQLDeSfGN"; // https://passwordsgenerator.net/
let sv_projectName = "Hello World"; // Wont allow other server name to run script

// https://cryptotools.net/rsagen
let rsaKey = `-----BEGIN PUBLIC KEY-----
MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgGL5iOvcjnIO9cUc7r7Afs/vZJ1d
UKJCT1v7XLIR4Dm9TLUroTSP1Slzi9yravq+dL1bsGH+bWXhDrlCN1ACi2IhxJA8
ki8B7iNvra+ZGoU2c0M59NqaZFfC5nCX5zgCld/0M//WZ58oXazcdih/fug1VPW3
e/zz2Eoh+oFzZ3+hAgMBAAE=
-----END PUBLIC KEY-----`

// List of excluding to encryption of .lua files
const excludeList_LUA = [
	"config/", // Define as path
	"locales/",
	"config.lua", // Define as file name
	"fxmanifest.lua",
];

// List of excluding to encryption of .js files
const excludeList_JS = [
	"utk_render/", // Define as path
	"module/",
	"config.js", // Define as file name
];
```

{% hint style="info" %}
Don't forget to save your private key
{% endhint %}

## server.cfg

Add convar to server from above config

```batch
setr sv_projectName "Hello World"
setr elKey "g4dHxF7MQLDeSfGN"
```
