crypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package crypto provides AES-256-CTR encryption and HMAC-SHA1 authentication compatible with git-crypt.

Index

Constants

This section is empty.

Variables

View Source
var ErrHMACMismatch = errors.New("crypto: HMAC verification failed")

ErrHMACMismatch indicates that the HMAC verification failed during decryption.

Functions

func Decrypt

func Decrypt(data []byte, key *keyfile.Key) ([]byte, error)

Decrypt decrypts a git-crypt encrypted file using AES-256-CTR and verifies the HMAC-SHA1 nonce.

func Encrypt

func Encrypt(plaintext []byte, key *keyfile.Key) ([]byte, error)

Encrypt encrypts plaintext using AES-256-CTR with an HMAC-SHA1 derived nonce, producing output compatible with git-crypt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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