Documentation
¶
Index ¶
- Constants
- Variables
- func Decrypt(r io.Reader, w io.Writer, pass []byte, printFn PrintFunc) (sign []byte, err error)
- func DecryptVerify(r io.Reader, w io.Writer, pass []byte, signex []byte, printFn PrintFunc) (sign []byte, err error)
- func Encrypt(r io.Reader, w io.Writer, pass []byte, cipher Cipher, mode Mode, kdf KDF, ...) (sign []byte, err error)
- func FormatSize(n int64) string
- func GetCipherString() string
- func GetKDFString() string
- func GetMACString() string
- func GetMDString() string
- func GetModeString() string
- func GetSecIterMemory(sec int) (int, int64, int)
- func Validate(cipher Cipher, mode Mode, kdf KDF, mac MAC, md MD, sec int) (err error)
- type Cipher
- type Header
- type KDF
- type MAC
- type MD
- type Meta
- type Mode
- type PrintFunc
- type ProgressWriter
- type StreamMode
Constants ¶
View Source
const ( DefaultCipher = AES_256 DefaultMode = CTR DefaultKDF = Argon2 DefaultMAC = HMAC DefaultMD = SHA_256 DefaultSec = 10 )
View Source
const ( MinSec = 0 MaxSec = 20 )
View Source
const ( CipherDesc = "cipher" ModeDesc = "stream mode" KDFDesc = "key derivation" MACDesc = "message authentication" MDDesc = "message digest" SecDesc = "security level" )
View Source
const HeaderVersion = headerVer7
Variables ¶
View Source
var CipherNames = map[Cipher]string{ AES_256: "AES-256", ChaCha20: "ChaCha20", }
View Source
var ErrSigVer = errors.New("signature verification failed")
View Source
var MACNames = map[MAC]string{ HMAC: "HMAC", }
View Source
var MDNames = map[MD]string{ SHA3_224: "SHA3-224", SHA3_256: "SHA3-256", SHA3_384: "SHA3-384", SHA3_512: "SHA3-512", SHA_224: "SHA-224", SHA_256: "SHA-256", SHA_384: "SHA-384", SHA_512: "SHA-512", SHA_512_224: "SHA-512/224", SHA_512_256: "SHA-512/256", BLAKE2b_256: "BLAKE2b-256", BLAKE2b_384: "BLAKE2b-384", BLAKE2b_512: "BLAKE2b-512", }
Functions ¶
func DecryptVerify ¶ added in v1.3.1
func FormatSize ¶ added in v1.6.10
func GetCipherString ¶ added in v1.4.0
func GetCipherString() string
func GetKDFString ¶ added in v1.4.0
func GetKDFString() string
func GetMACString ¶ added in v1.4.0
func GetMACString() string
func GetMDString ¶ added in v1.4.0
func GetMDString() string
func GetModeString ¶ added in v1.3.0
func GetModeString() string
Types ¶
type PrintFunc ¶
type PrintFunc func(version int, cipher Cipher, mode Mode, kdf KDF, mac MAC, md MD, sec int, pass, salt, iv, keyCipher, keyMAC []byte) error
func NewPrintFunc ¶ added in v1.6.11
type ProgressWriter ¶ added in v1.19.1
type ProgressWriter struct { TotalBytes int64 // contains filtered or unexported fields }
func (*ProgressWriter) Progress ¶ added in v1.19.1
func (w *ProgressWriter) Progress(done <-chan struct{}, d time.Duration)
Click to show internal directories.
Click to hide internal directories.