gosecure

command module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 11 Imported by: 0

README

GitHub GitHub commit activity (branch) GitHub last commit (branch) GitHub release (with filter)

Description

A simple utility to easily encrypt and decrypt files written in Golang. Goshield utilizes the AES-256-GCM symetric encryption algorithm and Argon2id key derivation function to secure files. Files are encrypted and decrypted utilizing a user provided password.

Instructions

Installation

  1. Navigate to the latest release
  2. Download the binary appropriate for your operating system and architecture (Windows-AMD64 or Linux-AMD64)
  3. Additionally, you can download the latest source and build an appropriate binary for your architecture Note: We are only able to support official builds

Usage

File Encryption
$ ./gosecure -e -in "/path/to/file" -k "<Your-Password>"
File Decryption
$ ./gosecure -d -in "/path/to/file" -k "<Your-Password>"

Command Line Options

-e      Encrypt the input data.
-d      Decrypt the input data.
-in     The input filename, standard input by default.
-k      The password to derive the key from.
-v      Enables verbosity to default logger.
-debug  Enables debug output to default logger.

Process Diagrams

Encryption

┌────────┐  ┌──────────┐  ┌─────────────────────────────────┐
│  SALT  │  │ Password │  │            Plaintext            │
└────┬───┘  └───────┬──┘  └────────────────┬────────────────┘
     │              │                      │
     │              │                      │
     ├──────────┐   │                      │
     │          │   │                      │
     │          ▼   ▼                      ▼
     │    ┌────────────────┐      ┌──────────────────┐
     │    │                │      │                  │
     │    │  Argon2id KDF  ├─────►│  GCM Encryption  │
     │    │                │      │                  │
     │    └────────────────┘      └────────┬─────────┘
     │                                     │
     │                                     │
     ▼                                     ▼
 ┌────────┬─────────────────────────────────────────────────┐
 │  SALT  │                     Ciphertext                  │
 ├────────┼─────────────────────────────────────────────────┤
 0        32                                               EOF

Decryption

               0        32                                               EOF
 ┌──────────┐  ├────────┼─────────────────────────────────────────────────┤
 │ Password │  │  SALT  │                     Ciphertext                  │
 └─────┬────┘  └───┬────┴──────────────────────────┬──────────────────────┘
       │           │                               │
       │           │                               │
       │           │                               │
       │           │                               │
       │           │                               │
       ▼           ▼                               ▼
     ┌────────────────┐                  ┌──────────────────┐
     │                │                  │                  │
     │  Argon2id KDF  ├─────────────────►│  GCM Encryption  │
     │                │                  │                  │
     └────────────────┘                  └─────────┬────────┘
                                                   │
                                                   │
                                                   ▼
                         ┌─────────────────────────────────────────────────┐
                         │                     Plaintext                   │
                         └─────────────────────────────────────────────────┘

Credit

Initial development and work is based off of the hard work of the following folks:

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