crypto

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSalt = "crypto"
)

Functions

func Decode

func Decode(s, key []byte) ([]byte, error)

decode bytes by aes cfb

func Encode

func Encode(s, key []byte) ([]byte, error)

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is an io.Reader that can read encrypted bytes. Now it only supports aes-128-cfb.

func NewReader

func NewReader(r io.Reader, key []byte) *Reader

NewReader returns a new Reader that decrypts bytes from r

func (*Reader) Read

func (r *Reader) Read(p []byte) (nRet int, errRet error)

Read satisfies the io.Reader interface.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer is an io.Writer that can write encrypted bytes. Now it only support aes-128-cfb.

func NewWriter

func NewWriter(w io.Writer, key []byte) (*Writer, error)

NewWriter returns a new Writer that encrypts bytes to w.

func (*Writer) Write

func (w *Writer) Write(p []byte) (nRet int, errRet error)

Write satisfies the io.Writer interface.

Jump to

Keyboard shortcuts

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