CovenantSQL: Index | Files

package symmetric

import ""

Package symmetric implements Symmetric Encryption methods.


Package Files



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")

func DecryptWithPassword Uses

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

DecryptWithPassword decrypts data with given password.

func EncryptWithPassword Uses

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 Uses

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

KeyDerivation does sha256 twice to password.

Package symmetric imports 7 packages (graph) and is imported by 6 packages. Updated 2019-06-07. Refresh now. Tools for package owners.