fileprotect

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 12 Imported by: 0

README

fileprotect

Command line utility to encrypt and decrypt data.

A work in progress!

Install

go install github.com/ryanfowler/fileprotect@latest

Usage

To encrypt a secret, run the command:

fileprotect secret encrypt "this is a secret"

The encrypt command will ask for a password to encrypt the secret with, and will then output the encrypted result in hexadecimal format.

To decrypt your data, run the command:

fileprotect secret decrypt 2b86dc46601e0046df8bb891f702fa9fd11edc9301e44b51db556671a3803334fb1dcdbe52d256422546ffc6d378ad13696b8c99a4269d8a5aca611f1dd2cc

The decrypt command will also ask for the password you used to encrypt the data, and, if successful, output the result.

How it works

fileprotect uses the argon2id key derivation function to hash your password. It takes the resulting 32 byte hash and uses that as the key to the xchacha20-poly1305 authenticated encryption algorithm.

Salts and nonces are created using a cryptographically secure random number generator. This means that encrypting the same secret multiple times will result in different output.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL