# f4st_crypt

> A NodeJS text and files encryptor/decryptor.

Latest version **1.0.7** (published 2020-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install f4st_crypt
pnpm add f4st_crypt
yarn add f4st_crypt
bun add f4st_crypt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2020-07-22 |
| First published | 2020-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Baiano - F4st Hosting |
| Maintainers | f4sthosting |
| Keywords | npm, blowfish, encrypt, decrypt, encryption, file, decryption, js, crypto, stream, jscrypt, aes, 128, 192, 256, des, camellia, cbc, cfb, ctr, ecb, ofb, xts, hmac, sha256, sha1, cast, ecb, ede, rc2, rc4, seed, md5, hash, security, secure, fast, files, bcrypt, password, auth, authentication, encryption, crypt, crypto, security, database, level, information, databases, dbs |

## Links

- npm: https://www.npmjs.com/package/f4st_crypt
- Repository: https://github.com/F4stHosting/F4st_Crypt
- Homepage: https://github.com/F4stHosting/F4st_Crypt/
- Issues: https://github.com/F4stHosting/F4st_Crypt/issues
- npm.io page: https://npm.io/package/f4st_crypt

## Dependencies (1)

- [crypto](https://npm.io/package/crypto.md) ^1.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.7 (latest) — 2020-07-22
- 1.0.6 — 2020-07-21
- 1.0.5 — 2020-07-20
- 1.0.4 — 2020-07-20
- 1.0.0 — 2020-07-20
- 1.0.3 — 2020-07-20

## README

# F4st_Crypt (or F4cry)
An NPM module (nodeJS) that uses crypto to encrypt/decrypt files and text in a robust way, that does not damage the file and also in small functions.

<p>
<a href="https://www.npmjs.com/package/f4st_crypt" rel="nofollow"><img src="https://img.shields.io/npm/dw/f4st_crypt.svg?logo=npm" alt="npm downloads" style="max-width:100%;"></a>
<a href="https://www.npmjs.com/package/f4st_crypt" rel="nofollow"><img src="https://img.shields.io/npm/v/f4st_crypt.svg?logo=npm" alt="npm version" style="max-width:100%;"></a>
<a href="https://github.com/F4stHosting/F4st_Crypt/blob/master/LICENSE" rel="nofollow"><img src="https://img.shields.io/npm/l/f4st_crypt.svg?logo=github" alt="NpmLicense"></a>
<a href="https://github.com/F4stHosting/F4st_Crypt/blob/master/" rel="nofollow"><img src="https://img.shields.io/badge/Accepting%20Commits-True-green.svg" alt="Conventional Commits"></a>
<a href="https://github.com/F4stHosting/F4st_Crypt/blob/master/" rel="nofollow"><img src="https://img.shields.io/github/package-json/v/f4sthosting/F4st_Crypt.svg" alt="Conventional Commits"></a>
<a href="https://discord.gg/7kxvCse" rel="nofollow"><img src="https://img.shields.io/badge/Join%20Our%20Discord-%20-7289DA?logo=discord" alt="Discord"></a>

</p>

How to Use?

You can easily use this module in some simple functions:

<br>
<br>

**Text**

<br>

> Text Encrypting

<br>

```js
var f4cry = require("F4st_Crypt");
var ncryptxt = f4cry.encrypt("A foo and a bar", "My Password", null, null);
console.log(ncryptxt);
```

"null, null" is telling to the program to auto-generate the algorithm and iv processor.

And it will return like:
```json
{
  type: 'encrypt',
  text: '9cbc314d4ebf883f581fa3e4192e2ed6',
  password: 'My Password',
  algorithm: 'aes-256-cbc',
  iv: 'e27294577aedb2b9ff62a84a9ed23ead'
}
```

<br>
<br>

> Text Decrypting

```js
var f4cry = require("F4st_Crypt");

var dcryptxt = f4cry.decrypt(ncryptxt.text, ncryptxt.password, ncryptxt.algorithm, ncryptxt.iv)
console.log(dcryptxt);
```

We are using encrypt text json response with "ncryptxt".

And it will return it like:
```A foo and a bar```

<br>
<br>
<br>
<br>

**Files**

<br>

> File Encrypting

<br>

Easily encrypt files with this function:

```js
var f4cry = require("F4st_Crypt");
var ncrypt = f4cry.encryptFile("./test/test_file.rar", "./test/test_file_crypted.rar", "password", algorithm, iv_processor, (progress) =>{console.log(progress)});
    console.log(ncrypt)
```

It will return a json string like(useful for saving/using auto-generated IV processors): 
```json
{
  type: 'encrypt',
  from: './test/test_file.rar',
  to: './test/test_file_crypted.rar',
  password: 'senha',
  algorithm: 'aes-256-cbc',
  iv: 'f1562b6de15f7a228799bb906355c2e0'
}
```

<br>
<br>

> File Decrypting

<br>

Easily decrypt files with this function:

```js
var f4cry = require("F4st_Crypt");
var dcrypt = f4cry.decryptFile( "./test/test_file_crypted.rar",  "./test/test_file_decrypted.rar", ncrypt.password, ncrypt.algorithm, ncrypt.iv,(progress) =>{console.log(progress)})
    console.log(dcrypt)
```

It will return a json string too:

```json
{
  type: 'decrypt',
  from: './test/test_file_crypted.rar',
  to: './test/test_file_decrypted.rar',
  password: 'senha',
  algorithm: 'aes-256-cbc',
  iv: 'f1562b6de15f7a228799bb906355c2e0'
}
```

<br>
<br>
<br>
<br>

# Note

**Supported Algorithms:**

AES-128-CBC, AES-128-CBC-HMAC-SHA1, AES-128-CBC-HMAC-SHA256, AES-128-CFB, AES-128-CFB1, AES-128-CFB8, AES-128-CTR, AES-128-ECB, AES-128-OFB, AES-128-XTS, AES-192-CBC, AES-192-CFB, AES-192-CFB1, AES-192-CFB8, AES-192-CTR, AES-192-ECB, AES-192-OFB, AES-256-CBC, AES-256-CBC-HMAC-SHA1, AES-256-CBC-HMAC-SHA256, AES-256-CFB, AES-256-CFB1, AES-256-CFB8, AES-256-CTR, AES-256-ECB, AES-256-OFB, AES-256-XTS, AES128 => AES-128-CBC, AES192 => AES-192-CBC, AES256 => AES-256-CBC.


(We're also accepting improvements, don't be afraid, even if it's simple, make your commit!)

---
_Source: https://npm.io/package/f4st_crypt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
