Documentation
¶
Index ¶
- Constants
- Variables
- func Decrypt(r io.Reader, w io.Writer, key []byte, printFunc PrintFunc) (sign []byte, err error)
- func DecryptArchive(r io.Reader, w io.Writer, key []byte, printFunc PrintFunc) (sign, signex []byte, err error)
- func DecryptVerify(r io.Reader, w io.Writer, key, signex []byte, printFunc PrintFunc) (sign []byte, err error)
- func Encrypt(r io.Reader, w io.Writer, key []byte, cipher Cipher, hash Hash, kdf KDF, ...) (sign []byte, err error)
- func EncryptArchive(r io.Reader, w io.Writer, key []byte, size int64, cipher Cipher, hash Hash, ...) (sign []byte, err error)
- func FormatSize(n int64, dec uint) string
- func GetMemory(sec int) int64
- func Verify(x, y []byte) error
- type Cipher
- type Hash
- type Header
- type KDF
- type Meta
- type PrintFunc
- type ProgressWriter
Constants ¶
View Source
const ( DefaultCipher = AES_256_CTR DefaultKDF = Argon2id DefaultHash = SHA_256 DefaultSec = 10 )
View Source
const ( MinSec = 0 MaxSec = 20 )
View Source
const ( CipherDesc = "cipher" KDFDesc = "key derivation" HashDesc = "hash" SecDesc = "security" )
View Source
const Magic = 1195920895
View Source
const Version = v8
Variables ¶
View Source
var ( MetaSize = int64(binary.Size(meta)) HeaderSize = int64(binary.Size(header)) OverheadSize = MetaSize + HeaderSize )
View Source
var ( ErrKey = errors.New("geheim: empty key") ErrHeader = errors.New("geheim: malformed header") ErrSign = errors.New("geheim: signature verification failed") ErrCipher = fmt.Errorf("geheim: invalid %s (%s)", CipherDesc, CipherString) ErrKDF = fmt.Errorf("geheim: invalid %s (%s)", KDFDesc, KDFString) ErrHash = fmt.Errorf("geheim: invalid %s (%s)", HashDesc, HashString) ErrSec = fmt.Errorf("geheim: invalid %s (%s)", SecDesc, SecString) )
View Source
var CipherNames = map[Cipher]string{ AES_256_CTR: "AES-256-CTR", ChaCha20: "ChaCha20", }
View Source
var CipherString = getOptionString(ciphers[:], CipherNames)
View Source
var HashNames = map[Hash]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", }
View Source
var HashString = getOptionString(hs[:], HashNames)
View Source
var KDFString = getOptionString(kdfs[:], KDFNames)
Functions ¶
func DecryptArchive ¶ added in v1.25.3
func DecryptVerify ¶ added in v1.3.1
func EncryptArchive ¶ added in v1.25.3
func FormatSize ¶ added in v1.6.10
Types ¶
type PrintFunc ¶
func NewDefaultPrintFunc ¶ added in v1.22.5
type ProgressWriter ¶ added in v1.19.1
type ProgressWriter struct { TotalBytes int64 // contains filtered or unexported fields }
func NewProgressWriter ¶ added in v1.23.2
func NewProgressWriter(total int64) *ProgressWriter
func (*ProgressWriter) Progress ¶ added in v1.19.1
func (w *ProgressWriter) Progress(duration time.Duration, done <-chan struct{})
func (*ProgressWriter) Reset ¶ added in v1.23.2
func (w *ProgressWriter) Reset()
Click to show internal directories.
Click to hide internal directories.