crypto

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCredentials

func DecryptCredentials(encrypted string) (accessKey, secretKey string, err error)

DecryptCredentials reverses EncryptCredentials.

func DecryptString added in v0.2.0

func DecryptString(encoded string) (string, error)

DecryptString reverses EncryptString. It fails if the ciphertext is corrupted, truncated, or was not produced on this device (the device key differs).

func EncryptCredentials

func EncryptCredentials(accessKey, secretKey string) (string, error)

EncryptCredentials encrypts AWS credentials using the device-specific key. The access and secret keys are combined with a ":" separator.

func EncryptString added in v0.2.0

func EncryptString(plaintext string) (string, error)

EncryptString encrypts an arbitrary string using the device-specific key (AES-256-GCM, random nonce, base64-encoded result). The output includes the nonce as a prefix to the ciphertext.

func GetDeviceKey

func GetDeviceKey() ([]byte, error)

GetDeviceKey derives a unique encryption key from device-specific data. It dispatches to a platform-specific collector, falling back to a hostname-based identity when none is available, then SHA-256s the result together with a project-wide salt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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