symmetric

package
v0.0.0-...-020e20f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package symmetric implements Symmetric Encryption methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInputSize indicates cipher data size is not expected,
	// maybe data is not encrypted by EncryptWithPassword in this package
	ErrInputSize = errors.New("cipher data size not match")
)

Functions

func DecryptWithPassword

func DecryptWithPassword(in, password []byte, salt []byte) (out []byte, err error)

DecryptWithPassword decrypts data with given password.

func EncryptWithPassword

func EncryptWithPassword(in, password []byte, salt []byte) (out []byte, err error)

EncryptWithPassword encrypts data with given password, iv will be placed at head of cipher data.

func KeyDerivation

func KeyDerivation(password []byte, salt []byte) (out []byte)

KeyDerivation does sha256 twice to password.

Types

This section is empty.

Jump to

Keyboard shortcuts

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