Categorygithub.com/itdesign-at/golib/crypt
package
1.0.0
Repository: https://github.com/itdesign-at/golib.git
Documentation: pkg.go.dev

# README

package crypt

FunctionComment
func NewBcrypt() Bcryptcreates an bcrypt handler
func (b *bcryptProperties) Encrypt(plainText string) (string, error)encrypt plaintext
func (b *bcryptProperties) HashedText(hashedText string)set a hashed text string
func (b *bcryptProperties) PlainText(plainText string)set a plain text string
func (b *bcryptProperties) Cost(cost int)sets bcrypt costs
func (b *bcryptProperties) Compare() boolchecks the hash against the plaintext
func GenerateEd25519KeyFiles(dir string, filename string) (string, error)generates ed25519 key files (id_ed25519 and id_ed25519.pub)
func NewEncryptedString(plainTextValue string) EncryptedStringcreates an Encrypted string
func NewDecryptedString(encryptedValue string) stringdecrypt an encrypted string
func (v EncryptedString) Value() stringreturns the decrypted plainTextValue
func (v EncryptedString) String() stringreturns the decrypted plainTextValue
func (v EncryptedString) MarshalText() ([]byte, error)
func (v *EncryptedString) UnmarshalText(text []byte) error
func (v EncryptedString) MarshalBinary() ([]byte, error)
func NewSymmetricEncryption() *SymCryptcreates an SymCrypt handler
func (s *SymCrypt) SetKey(key string) *SymCryptset an AES key
func (s *SymCrypt) SetPlainText(plainText string) *SymCryptset plain text to encrypt.
func (s *SymCrypt) GetCypherBase64() stringreturns the encrypted data stream as base64 encoded
func (s *SymCrypt) SetCypherBase64(base64String string) *SymCryptset cipher text as base64 string.
func (s *SymCrypt) GetPlainText() (string, error)returns the plaintext