cryptoCmd

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileCryptoCmd = &cobra.Command{
	Use:     "file-crypt <file-path>",
	Aliases: []string{"fc"},
	Short:   "Encrypt or decrypt files using AES-256-GCM with a password-based symmetric encryption",
	Args:    cobra.ExactArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		if fileCryptoFlags.password == "" {
			log.Fatal().Msg("No password specified")
		}
		if fileCryptoFlags.decrypt {
			anbuCrypto.DecryptFileSymmetric(args[0], fileCryptoFlags.password)
		} else {
			anbuCrypto.EncryptFileSymmetric(args[0], fileCryptoFlags.password)
		}
	},
}
View Source
var KeyPairCmd = &cobra.Command{
	Use:     "key-pair",
	Aliases: []string{},
	Short:   "Generate RSA key pairs in PEM or SSH format",
	Run: func(cmd *cobra.Command, args []string) {
		keyName := filepath.Base(keyPairFlags.outputPath)
		keyDir := filepath.Dir(keyPairFlags.outputPath)
		if keyPairFlags.noSSHFormat {
			anbuCrypto.GenerateKeyPair(keyDir, keyName, keyPairFlags.keySize)
		} else {
			anbuCrypto.GenerateSSHKeyPair(keyDir, keyName, keyPairFlags.keySize)
		}
	},
}
View Source
var SecretsCmd = &cobra.Command{
	Use:     "pass",
	Aliases: []string{"p"},
	Short:   "Manage secrets with AES-GCM encryption with support for single and multiline inputs and custom password",
}
View Source
var SecretsScanCmd = &cobra.Command{
	Use:     "secret-scan [path]",
	Aliases: []string{},
	Short:   "Scan directories for potential secrets using regex patterns and filter results by confidence level",
	Args:    cobra.MaximumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		scanPath := "."
		if len(args) > 0 {
			scanPath = args[0]
		}
		anbuCrypto.ScanSecretsInPath(scanPath, printFalsePositives)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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