entomb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 11 Imported by: 1

README

Go Release

entomb

import "github.com/engmtcdrm/go-entomb"

Package entomb allows for the encryption and decryption of data using the Fernet symmetric encryption algorithm. It includes additional salting, hashing, and code obfuscation to make it harder for attackers to reverse-engineer the code.

Anything encrypted with this package can only be decrypted by the original user and machine that encrypted it.

Index

type Tomb

Encryptor/Decryptor

Into the depths we dive, where the secrets lie...

type Tomb struct {
    // contains filtered or unexported fields
}

func NewTomb
func NewTomb(keyPath string) (*Tomb, error)

Creates a new Tomb

The keyPath is the path to the key file. If the key file does not exist, a new key will be generated and saved to the key file. If the key file exists, the key will be read from the file.

func (*Tomb) Decrypt
func (tomb *Tomb) Decrypt(data []byte) ([]byte, error)

Decrypts the data and returns the decrypted message

func (*Tomb) Encrypt
func (tomb *Tomb) Encrypt(msg []byte) ([]byte, error)

Encrypts the message and returns the encrypted data

Generated by gomarkdoc

Documentation

Overview

Package entomb allows for the encryption and decryption of data using the Fernet symmetric encryption algorithm. It includes additional salting, hashing, and code obfuscation to make it harder for attackers to reverse-engineer the code.

Anything encrypted with this package can only be decrypted by the original user and machine that encrypted it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tomb

type Tomb struct {
	// contains filtered or unexported fields
}

Encryptor/Decryptor

Into the depths we dive, where the secrets lie...

func NewTomb

func NewTomb(keyPath string) (*Tomb, error)

Creates a new Tomb

The keyPath is the path to the key file. If the key file does not exist, a new key will be generated and saved to the key file. If the key file exists, the key will be read from the file.

func (*Tomb) Decrypt

func (tomb *Tomb) Decrypt(data []byte) ([]byte, error)

Decrypts the data and returns the decrypted message

func (*Tomb) Encrypt

func (tomb *Tomb) Encrypt(msg []byte) ([]byte, error)

Encrypts the message and returns the encrypted data

Jump to

Keyboard shortcuts

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