Documentation
¶
Index ¶
- func CompareWithHash(HashedString string, Password string) bool
- func CreateHash(Password string) (string, error)
- func Decrypt(encryptedData models.EncryptReturnType, ...) (interface{}, error)
- func Encrypt(data interface{}, encryptionKey, initializationVector, encryptionType string) (models.EncryptReturnType, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareWithHash ¶
CompareWithHash verifies a plain text password against a bcrypt hash Checks if the provided password matches the hashed password Returns true if the password matches, false otherwise
func CreateHash ¶
CreateHash generates a bcrypt hash from a plain text password Uses the default bcrypt cost factor to create a secure hash Returns the hashed password as a string or an error if hashing fails
func Decrypt ¶
func Decrypt(encryptedData models.EncryptReturnType, encryptionKey, initializationVector, encryptionType string) (interface{}, error)
Decrypt decrypts AES-encrypted data in CBC mode Decodes the input, decrypts it, removes padding, and unmarshals to the original data Supports base64 or hex decoding based on encryptionType
func Encrypt ¶
func Encrypt(data interface{}, encryptionKey, initializationVector, encryptionType string) (models.EncryptReturnType, error)
Encrypt encrypts data using AES in CBC mode Converts input data to JSON, pads it, encrypts it, and encodes the result Supports base64 or hex encoding based on encryptionType
Types ¶
This section is empty.