1.1.4 • Published 4 months ago

sifre v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Sifre

This is a CLI (Command Line Interface) that uses the native Node.js module crypto and the library Inquirer.js to encrypt and decrypt files.

!WARNING When using it, you will be prompted to enter a password, which you will need to remember to decrypt the file.

Installation

To install this CLI globally, you can use npm, yarn, or pnpm with the following command:

npm install -g sifre

Usage

Package

import { cipherContent, decipherContent, cipherFile, decipherFile } from "sifre";

const greeting = 'Hello, World!'
const buffer = Buffer.from(greeting);
const ciphered = cipherContent(buffer, 'myPassword');

console.log(ciphered);
// <Buffer 13 b9 86 08 92 35 33 ad 79 15 86 56 2f 7c 99 52 e3 9b 61 fb 2d cb 26 42 56 47 a3 78 c0>

console.log(ciphered.toString());
// '\x13��\b�53�y\x15�V/|�R�a�-�&BVG�x�'

const deciphered = decipherContent(ciphered, 'myPassword')

console.log(deciphered.toString());
// 'Hello, World!' 

// ---

cipherFile('hello.txt', 'otherPassword')
// In the same directory the file 'hello.txt.crypted' will be created

decipherFile('hello.txt.crypted', 'otherPassword')
// will decrypt the file 'hello.txt.crypted' and return to 'hello.txt' with the original content

CLI

Once installed, to encrypt a file, navigate to the folder where the file is located and run the following command:

sifre

You will be prompted to select file to encrypt and then enter a password.

!CAUTION This application does not use exhaustive encryption methods, so it is not recommended to encrypt extremely important documents. Additionally, if the password is forgotten or entered incorrectly, there is a risk of completely losing the file.

Decrypting a file

To decrypt a file, run the same command that you used to encrypt it. You will be prompted to enter the password that you used to encrypt the file.

1.1.1

4 months ago

1.1.0

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.11

5 months ago

1.0.21

5 months ago

1.0.10

5 months ago

1.0.20

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago