mino

package module
v1.0.1-0...-eee24a9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

Instruction

Fast&Secure encryption tool

Install

go get -u github.com/masterZSH/mino

Usage

// create a new key by pass and salt
k, err := mino.NewKey("myPass", "mySalt")

// Encrypt plaintext
cipherText, err := k.Encrypt(plainText)

// Decrypt ciphertext
plainText, err := k.Decrypt(cipherText)

Examples

1v1 command-line chat

Doc

doc

Ctl

minoctl

Documentation

Index

Constants

View Source
const (
	// KeyIter key iter
	KeyIter = 4096

	// KeyLen key length
	KeyLen = 32
)

Variables

View Source
var (
	// ErrMissKey miss key
	ErrMissKey = errors.New("key is not empty")

	// ErrMissSalt miss salt
	ErrMissSalt = errors.New("salt is not empty")

	// ErrKey invalid key
	ErrKey = errors.New("invalid key")

	// ErrCiphertext invalid ciphertext
	ErrCiphertext = errors.New("invalid ciphertext")
)

Functions

This section is empty.

Types

type Key

type Key struct {
	Content []byte
}

Key encrypt and decrypt key

func DefaultKey

func DefaultKey() (Key, error)

DefaultKey returns default key

func NewKey

func NewKey(passphrase []byte, salt []byte) (key Key, err error)

NewKey create new key

func (Key) Decrypt

func (key Key) Decrypt(ciphertext []byte) (plaintext []byte, err error)

Decrypt decrypt ciphertext

func (Key) Encrypt

func (key Key) Encrypt(plaintext []byte) (ciphertext []byte, err error)

Encrypt encrypt plaintext

Directories

Path Synopsis
cli
cmd
examples

Jump to

Keyboard shortcuts

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