Versions in this module Expand all Collapse all v1 v1.0.0 Apr 3, 2022 Changes in this version + const AES_128 + const AES_192 + const AES_256 + var ErrAesDecodeHEX = errors.New("[cryptor/AES] failed to decode hex") + var ErrAesMakeCipher = errors.New("[cryptor/AES] make cipher failed") + var ErrAesMakeGCM = errors.New("[cryptor/AES] make GCM failed") + var ErrAesOpenGCM = errors.New("[cryptor/AES] open GCM failed") + var ErrAesReadNonce = errors.New("[cryptor/AES] read nonce failed") + var ErrAesSecretLength = errors.New("[cryptor/AES] secret must be 16/24/32 bytes length") + var ErrArgonIncompatibleVariant = errors.New("[cryptor/argon] incompatible variant of argon2") + var ErrArgonIncompatibleVersion = errors.New("[cryptor/argon] incompatible version of argon2") + var ErrArgonInvalidHash = errors.New("[cryptor/argon] hash is not in the correct format") + var ErrBcryptDataTooBig = errors.New("[cryptor/bcrypt] max password size is 72 bytes") + var ErrBcryptHashNotRadix = errors.New("[cryptor/bcrypt] hash not matches with radix") + var ErrBcryptHashWrongLength = errors.New("[cryptor/bcrypt] hash must have 60 bytes length") + var ErrBcryptInvalidHash = errors.New("[cryptor/bcrypt] invalid hash") + var ErrBcryptNoDollar = errors.New("[cryptor/bcrypt] hash must have $ at start") + var ErrBcryptSaltNotRadix = errors.New("[cryptor/bcrypt] salt not matches with radix") + var ErrBcryptUnsupportedVersion = errors.New("[cryptor/bcrypt] this version not supported") + var ErrBcryptWrongCost = errors.New("[cryptor/bcrypt] cost NaN") + type AES struct + Secret string + func New_AES(secret string) (*AES, error) + func (a *AES) Decrypt(encrypted string) (string, error) + func (a *AES) Encrypt(text string) (encrypted string, err error) + type Argon struct + Iterations uint32 + KeyLength uint32 + Memory uint32 + Parallelism uint8 + SaltLength uint32 + func New_Argon(config *Argon) *Argon + func (a *Argon) Compare(password, hash string) (match bool, err error) + func (a *Argon) GetDefaults() *Argon + func (a *Argon) Hash(password string) (hash string, err error) + func (a *Argon) IsHash(data string) bool + func (a *Argon) Parse(hash string) (config *Argon, salt, key []byte, err error) + type BCrypt struct + Cost int + func New_BCrypt(cost int) *BCrypt + func (b *BCrypt) Compare(password, hash string) (isMatch bool, err error) + func (b *BCrypt) Hash(password string) (hash string, err error) + func (b *BCrypt) IsHash(data string) bool + func (b *BCrypt) Parse(hash string) (*BCryptHash, error) + type BCryptHash struct + Cost int + Hash string + Salt string + Version string