Skip to content

A simple utility to easily encrypt and decrypt files written in Golang.

License

Notifications You must be signed in to change notification settings

acavella/gosecure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GoSecure Logo

GitHub GitHub commit activity (branch) GitHub last commit (branch) GitHub go.mod Go version (branch & subdirectory of monorepo) GitHub release (with filter)

Description

A simple utility to encrypt and decrypt files utilizing a user provided password. GoSecure is written in Golang utilizing the standard crypto libraries. Files are encrypted utlizing AES-256-GCM symetric encryption algorithm and Argon2id key derivation function.

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:

About

A simple utility to easily encrypt and decrypt files written in Golang.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages