encryption

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareWithHash

func CompareWithHash(HashedString string, Password string) bool

CompareWithHash verifies a plain text password against a bcrypt hash. Returns true if the password matches the hash, false otherwise.

func CreateHash

func CreateHash(Password string) (string, error)

CreateHash generates a bcrypt hash from a plain text password. Returns the hashed password as a string or an error if hashing fails.

func Decrypt

func Decrypt(encryptedData models.EncryptReturnType) (interface{}, error)

Decrypt decrypts AES-encrypted data in CBC mode and returns the original data. Supports Base64 or hex-encoded input. Returns the decrypted data or an error if decryption fails.

func Encrypt

func Encrypt(data interface{}) (*models.EncryptReturnType, error)

Encrypt encrypts data using AES in CBC mode and returns an encoded payload. Supports Base64 or hex encoding for the ciphertext. Returns the encrypted payload or an error if encryption fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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