crypt

package
v0.0.0-...-ed45f3b Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(data []byte, key []byte) ([]byte, error)

Encrypt encrypts data by given passphrase

Types

type Crypt

type Crypt struct{}

Crypt is struct used to represent crypting functions

func (Crypt) Decrypt

func (c Crypt) Decrypt(ciphertext []byte, key []byte) ([]byte, error)

Decrypt decrypts data by given passphrase

func (Crypt) DecryptFile

func (c Crypt) DecryptFile(filename string, key []byte) ([]byte, error)

DecryptFile decrypts file by given password

func (Crypt) EncryptFile

func (c Crypt) EncryptFile(filename string, data []byte, key []byte) error

EncryptFile encrypts given data with cypher algorithm and saves it to file.

type Crypter

type Crypter interface {
	EncryptFile(string, []byte, []byte) error
	DecryptFile(string, []byte) ([]byte, error)
	Decrypt([]byte, []byte) ([]byte, error)
}

Crypter interface abstacts encrypting and decrypting values

Jump to

Keyboard shortcuts

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