aea

package
v0.0.0-prerelease Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Magic                                = "AEA1"
	MainKeyInfo                          = "AEA_AMK"
	RootHeaderEncryptedKeyInfo           = "AEA_RHEK"
	ClusterKeyInfo                       = "AEA_CK"
	ClusterKeyMaterialInfo               = "AEA_CHEK"
	SegmentKeyInfo                       = "AEA_SK"
	SignatureEncryptionDerivationKeyInfo = "AEA_SEK"
	SignatureEncryptionKeyInfo           = "AEA_SEK2"
	PaddingKeyInfo                       = "AEA_PAK"
)
View Source
const (
	Signed                     profileType = 0
	SymmetricEncryption        profileType = 1
	SymmetricEncryptionSigned  profileType = 2
	AsymmetricEncryption       profileType = 3
	AsymmetricEncryptionSigned profileType = 4
	PasswordEncryption         profileType = 5
)
View Source
const (
	None   checksumType = 0
	Murmur checksumType = 1
	Sha256 checksumType = 2
)
View Source
const (
	NONE     compressionType = '-'
	LZ4      compressionType = '4'
	LZBITMAP compressionType = 'b'
	LZFSE    compressionType = 'e'
	LZVN     compressionType = 'f'
	LZMA     compressionType = 'x'
	ZLIB     compressionType = 'z'
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(c *DecryptConfig) (string, error)

func Encrypt

func Encrypt(in string, conf *EncryptConfig) error

func ID

func ID(in string) ([32]byte, error)

Types

type DecryptConfig

type DecryptConfig struct {
	Input       string // Input AEA file
	Output      string // Output directory
	PrivKeyData []byte // Private key data
	B64SymKey   string // Base64 encoded Symmetric encryption key
	PemDB       string // Path to PEM database
	Proxy       string // HTTP/HTTPS proxy
	Insecure    bool   // Allow insecure connections (skip TLS verification)
	// contains filtered or unexported fields
}

type EncryptConfig

type EncryptConfig struct {
	Output         string
	ProfileID      profileType
	ScryptStrength uint32
	Compression    compressionType
	CheckSum       checksumType
	B64SymKey      string
	SymmetricKey   []byte
	Password       string
	AuthData       []byte
}

type HMAC

type HMAC [32]byte
type Header struct {
	Magic                    [4]byte // AEA1
	ProfileAndScryptStrength uint32
	AuthDataLength           uint32
}

func (Header) ProfileID

func (h Header) ProfileID() profileType

func (Header) ScryptStrength

func (h Header) ScryptStrength() uint8

func (Header) String

func (h Header) String() string

type Keys

type Keys map[string][]byte

type Metadata

type Metadata map[string][]byte

func Info

func Info(in string) (Metadata, error)

func (Metadata) DecryptFCS

func (md Metadata) DecryptFCS(pemData []byte, pemDB string, proxy string, insecure bool) ([]byte, error)

func (Metadata) GetPrivateKey

func (md Metadata) GetPrivateKey(data []byte, pemDB string, skipEmbedded bool, proxy string, insecure bool) (map[string]PrivateKey, error)

type PrivateKey

type PrivateKey []byte

func (PrivateKey) UnmarshalBinaryPrivateKey

func (k PrivateKey) UnmarshalBinaryPrivateKey() ([]byte, error)

type RootHeader

type RootHeader struct {
	FileSize           uint64
	EncyptedSize       uint64
	SegmentSize        uint32
	SegmentsPerCluster uint32
	Compression        compressionType
	Checksum           checksumType
	// contains filtered or unexported fields
}

type SegmentHeader

type SegmentHeader struct {
	DecompressedSize uint32
	CompressedSize   uint32
	Checksum         [32]byte
}

Jump to

Keyboard shortcuts

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