cipherutil

package
v0.0.0-...-944d72e Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPasswordDidnotMatch indicates that given two passwords are not same.
	ErrPasswordDidnotMatch = errors.New("encryption password doesn't match")
)

Functions

func GetPassword

func GetPassword() ([]byte, error)

GetPassword reads password from stdin. This method prompts and read two times, and then verify the given two passwords is same. If they are same, then return it. Otherwise, an error returned.

func GetPasswordOnce

func GetPasswordOnce() ([]byte, error)

GetPasswordOnce reads password from stdin.

func ReadArchive

func ReadArchive(path string, password []byte) ([]byte, error)

ReadArchive reads encrypted archive and returns the decrypted data.

func WriteArchive

func WriteArchive(path string, data []byte, password []byte) error

WriteArchive writes plaintext to given pass with AES-256-GCM encryption. Encryption key is calculated from password with PBKDF2 key derivation function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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