cryptkeeper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(message []byte) (b []byte, err error)

func ComparePassword

func ComparePassword(password string, hash string) bool

func Decrypt

func Decrypt(hash string, salt string) (string, error)

Decrypt decrypts cipher text string into plain text string

func EncryptPassword

func EncryptPassword(text string) (string, error)

func PKCS5Padding

func PKCS5Padding(src []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(src []byte) []byte

func SetKeyName

func SetKeyName(newName string)

Types

type DecryptableContainer

type DecryptableContainer map[string]DecryptableData

func (DecryptableContainer) MarshalJSON

func (dst DecryptableContainer) MarshalJSON() ([]byte, error)

func (*DecryptableContainer) Scan

func (dst *DecryptableContainer) Scan(src interface{}) error

type DecryptableData

type DecryptableData struct {
	Hash string `json:"hash"`
	Salt string `json:"salt"`
}

func (DecryptableData) Decrypt

func (e DecryptableData) Decrypt() string

type EncryptableContainer

type EncryptableContainer map[string]EncryptableData

func (*EncryptableContainer) UnmarshalJSON

func (dst *EncryptableContainer) UnmarshalJSON(b []byte) error

func (EncryptableContainer) Value

func (dst EncryptableContainer) Value() (driver.Value, error)

type EncryptableData

type EncryptableData struct {
	Hash string `json:"hash"`
	Salt string `json:"salt"`
}

func Encrypt

func Encrypt(unencrypted string) (EncryptableData, error)

func (EncryptableData) Decrypt

func (e EncryptableData) Decrypt() string

Jump to

Keyboard shortcuts

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