encrypt

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AesKeyPepper = "bridgx"

Variables

View Source
var (
	ErrEncryptFailed = errors.New("encrypt failed")
	ErrDecryptFailed = errors.New("decrypt failed")
)
View Source
var (
	ErrWrongPepperOrSalt = errors.New("wrong pepper or salt")
	ErrRestoreTextFailed = errors.New("restore text failed")
)

Functions

func AESDecrypt

func AESDecrypt(key string, ct16 string) (text string, err error)

func AESEncrypt

func AESEncrypt(key, plaintext string) (text string, err error)

func ObfuscateText added in v0.2.1

func ObfuscateText(pepper, text, salt string) string

ObfuscateText will obfuscate text with pepper and salt.

func RestoreText added in v0.2.1

func RestoreText(pepper, obfuscated, salt string) (string, error)

RestoreText will restore obfuscated text with pepper and salt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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