fav

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

README

fav

fav employs age encryption for secure file encryption and decryption. It utilizes Shamir's Secret Sharing to split the generated age secret into multiple parts, distributing custody across various entities. These divided components are then stored in cloud storage, ensuring enhanced security and access control through collaborative key reconstruction.

Installation

Go
Installing latest version
go install gitlab.com/fav-cli/fav@latest
Installing spesific version
go install gitlab.com/fav-cli/fav@<tag>
go install gitlab.com/fav-cli/fav@v0.0.3
Build From Source
git clone https://gitlab.com/fav-cli/fav
cd fav
go install ./...

Configuration

The configuration for the "fav" CLI can be initialized through a configuration file named ".fav.yaml" in the working directory. Supported file formats for the configuration file include YAML, JSON, TOML.

storages:
  - name: ct-ember
    s3:
      region: ap-southeast-1
      bucket: ct-ember
      path: fav
  - name: idjo-ember
    gcs:
      bucket: ember.idjo.cc
      path: fav

The above example shows how to configure fav to use 2 storage bucket, one using s3 and one using gcs to dual custody the generated secret key.

Usage

CLI
Usage:
  fav [-e|-d] <file> [flags]
  fav [command]

Available Commands:
  completion  Generate completion script
  help        Help about any command

Flags:
  -d, --decrypt string   decrypt a file
  -e, --encrypt string   encrypt a file
  -h, --help             help for fav
      --remove           remove shared secret in bucket

Use "fav [command] --help" for more information about a command.
Library
Encrypt
package main

import (
	"log"
	"os"

	"gitlab.com/fav-cli/fav/pkg/crypto"
)

func main() {
	tmpFile, err := os.CreateTemp("/tmp", "fav-test-file")
	if err != nil {
		log.Fatal(err)
	}
	defer tmpFile.Close()

	_, err = tmpFile.WriteString("test data")
	if err != nil {
		log.Fatal(err)
	}

	err = crypto.Encrypt(tmpFile.Name(), false)
	if err != nil {
		log.Fatal(err)
	}
}
Decrypt
package main

import (
	"log"
	"os"

	"gitlab.com/fav-cli/fav/pkg/crypto"
)

func main() {
	tmpFile, err := os.CreateTemp("/tmp", "fav-test-file")
	if err != nil {
		log.Fatal(err)
	}
	defer tmpFile.Close()

	_, err = tmpFile.WriteString("test data")
	if err != nil {
		log.Fatal(err)
	}

	err = crypto.Encrypt(tmpFile.Name(), false)
	if err != nil {
		log.Fatal(err)
	}

	err = crypto.Decrypt(tmpFile.Name(), false)
	if err != nil {
		log.Fatal(err)
	}
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
fav
Package fav provides a command-line interface (CLI) tool for secure file encryption and decryption using age encryption.
Package fav provides a command-line interface (CLI) tool for secure file encryption and decryption using age encryption.
pkg
config
Package config provides config related code for fav configuration
Package config provides config related code for fav configuration
crypto
Package crypto provides tools for encrypting and decrypting files using age encryption and Shamir's Secret Sharing.
Package crypto provides tools for encrypting and decrypting files using age encryption and Shamir's Secret Sharing.
logger
Provides a configured instance of the logrus logger for use throughout the application.
Provides a configured instance of the logrus logger for use throughout the application.
storage
Provides an abstraction layer for interacting with different cloud storage providers, simplifying data upload and download operations.
Provides an abstraction layer for interacting with different cloud storage providers, simplifying data upload and download operations.
util
Provides utility functions for common file operations
Provides utility functions for common file operations

Jump to

Keyboard shortcuts

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