Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( HashMethodMD5 *MD5HashPassword HashMethodSHA1 *SHA1HashPassword HashMethodSHA256 *SHA256HashPassword HashMethodSHA512 *SHA512HashPassword )
Functions ¶
This section is empty.
Types ¶
type AESEncryptPassword ¶ added in v0.2.0
type AESEncryptPassword struct {
SecretKey string
}
func (AESEncryptPassword) Decrypt ¶ added in v0.2.0
func (r AESEncryptPassword) Decrypt(encryptedString string) (*string, error)
Decrypt string with AES-GCM
Will encrypt plain string to encryted string in (hex format)
if success will return encrypted string (hex format) and nil error
if fail will return encrypted string nil and error
func (AESEncryptPassword) Encrypt ¶ added in v0.2.0
func (r AESEncryptPassword) Encrypt(plainString string) (*string, error)
Encrypt string with AES-GCM
Will encrypt plain string to encryted string in (hex format)
if success will return encrypted string (hex format) and nil error
if fail will return encrypted string nil and error
type EncryptPassword ¶
type HashPassword ¶
type HashPassword interface { // abstract function of hashing // will be implemented on each hashing algorithm Hashing(plainString string) (*string, error) }
HashPassword interface of Hash Algorithm
type MD5HashPassword ¶
type MD5HashPassword struct { }
MD5HashPassword implements hashing password with MD5 algorithm
type RSAEncryptPassword ¶ added in v0.2.0
type RSAEncryptPassword struct {
Pk string
}
RSAEncryptPassword is implementation of RSA Encryption
func (RSAEncryptPassword) Decrypt ¶ added in v0.2.0
func (r RSAEncryptPassword) Decrypt(encryptedString string) (*string, error)
Decrypt
Will Decrypt encrypted string (hex format) to plain string ¶
if success will return plain string and nil error
if fail will return nil string and error
func (RSAEncryptPassword) Encrypt ¶ added in v0.2.0
func (r RSAEncryptPassword) Encrypt(plainString string) (*string, error)
Encrypt
Will encrypt plain string to encryted string in (hex format)
if success will return encrypted string (hex format) and nil error
if fail will return encrypted string nil and error
type SHA1HashPassword ¶
type SHA1HashPassword struct { }
SHA1HashPassword implements hashing password with SHA1 algorithm
type SHA256HashPassword ¶
type SHA256HashPassword struct { }
SHA256HashPassword implements hashing password with SHA256 algorithm
type SHA512HashPassword ¶
type SHA512HashPassword struct { }
SHA512HashPassword implements hashing password with SHA256 algorithm