securefile

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 9 Imported by: 0

README

securefile is a simple golang library for encrypting and decrypting files.

Installation

To install the package, run:

go get -v github.com/deeper-x/securefile

Usage

To encrypt data, run:

import "github.com/deeper-x/securefile"

key := "<YOUR PASSWD>"
_, err := securefile.Encrypt("/path/to/resource", []byte(key))
if err != nil {
	panic(err)
}

To decrypt data, run:

import "github.com/deeper-x/securefile"
            
key := "<YOUR PASSWD>"
_, err := securefile.Decrypt("/path/to/resource", []byte(key))
if err != nil {
	panic(err)
}

Test

go test -v ./...

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(source string, password []byte) (bool, error)

Decrypt decrypts a file using AES-GCM.

func Encrypt

func Encrypt(source string, password []byte) (bool, error)

Encrypt encrypts a file using AES-GCM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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