encryption

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncryptionPrefix    = "ENVI_ENCRYPTED:"
	MaskedPrefix        = "ENVI_MASKED:"
	EncryptionKeyLength = 32 // 256-bit key
)

Encryption constants

Variables

View Source
var (
	UseEncryption       bool
	UseMaskedEncryption bool
	UseKeyFile          bool
	EncryptionKeyFile   string
	EncryptionPassword  string
	UseTUI              bool = true
)

Encryption command flags

Functions

func DecryptContent

func DecryptContent(content []byte) ([]byte, error)

DecryptContent decrypts the given content using AES-256-GCM

func EncryptContent

func EncryptContent(content []byte) ([]byte, error)

EncryptContent encrypts the given content using AES-256-GCM

func InitEncryptionFlags

func InitEncryptionFlags(cmd *cobra.Command)

InitEncryptionFlags initializes encryption-related flags for commands

func IsEncrypted

func IsEncrypted(content []byte) bool

IsEncrypted checks if content is encrypted with full encryption

func IsMasked

func IsMasked(content []byte) bool

IsMasked checks if content is encrypted with masked encryption

func MaskEnvContent

func MaskEnvContent(content []byte) ([]byte, error)

MaskEnvContent masks the values in a .env file while keeping the keys visible

func UnmaskEnvContent

func UnmaskEnvContent(content []byte) ([]byte, error)

UnmaskEnvContent unmasks the values in a masked .env file

Types

This section is empty.

Jump to

Keyboard shortcuts

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