utils

package
v0.0.0-...-e75a48e Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotDecryptTokenContent = errors.New("unable to decrypt the token's content")
View Source
var ErrInvalidToken = errors.New("invalid token")

Functions

func AesDecrypt

func AesDecrypt(cipherText []byte, passPhrase string) (string, error)

AesDecrypt attempts to decrypt the provided bytes with the given passPhrase provided that it has been encrypted with AES256-GCM encryption

func AesEncrypt

func AesEncrypt(plainText string, passPhrase string) []byte

AesEncrypt uses AES256GCP to encrypt the provided plainText string using the given passPhrase

func CreateToken

func CreateToken(text string, passphrase string) string

CreateToken creates an encrypted substitution token from the given value

func DecryptToken

func DecryptToken(token string, passphrase string) (string, error)

DecryptToken extracts the payload from the provided substition token and decrypts its value using the given key

func Detokenize

func Detokenize(text string, passphrase string) (string, error)

Detokenize replaces all the encoded token by their clear text value

func Tokenize

func Tokenize(text string, passphrase string) (string, error)

Tokenize replaces a pre-tokenized file tokens with encrypted tokens

Types

This section is empty.

Jump to

Keyboard shortcuts

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