dencr

package
v0.0.0-...-5f7c8af Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Dec

func Base64Dec(s string) (decoded string)

func Base64Enc

func Base64Enc(s string) (encoded string)

===================================================================================================================== ENCODING -- BASE64 =====================================================================================================================

func OptionRSA

func OptionRSA() *rsaOption

func SHA256

func SHA256(data []byte) []byte

===================================================================================================================== SHA 256 HASHING =====================================================================================================================

func SHA256s

func SHA256s(data []byte) string

Types

type Encryption

type Encryption struct {
	// contains filtered or unexported fields
}

===================================================================================================================== ENCRYPTION =====================================================================================================================

func NewEncryption

func NewEncryption(commonKey string, options ...func(enc *Encryption)) *Encryption

func (*Encryption) Decrypt

func (enc *Encryption) Decrypt(s []byte) []byte

func (*Encryption) Decrypts

func (enc *Encryption) Decrypts(s string) string

func (*Encryption) Encrypt

func (enc *Encryption) Encrypt(s []byte) []byte

func (*Encryption) Encrypts

func (enc *Encryption) Encrypts(s string) string

func (*Encryption) SetLogger

func (enc *Encryption) SetLogger(l *log.Logger) *Encryption

type ErrorRSA

type ErrorRSA struct {
	Err error
}

func (*ErrorRSA) Error

func (e *ErrorRSA) Error() string

type RSA

type RSA struct {
	PEM_PRIVATE   string
	PEM_PUBLIC    string
	TXT_ENCRYPTED string
	TXT_PLAIN     string
	// contains filtered or unexported fields
}

func NewRSA

func NewRSA(fns ...func(*RSA)) *RSA

func (*RSA) Debug

func (m *RSA) Debug()

func (*RSA) Decrypt

func (m *RSA) Decrypt() (err error)

func (*RSA) Encrypt

func (m *RSA) Encrypt() (err error)

func (*RSA) GenerateKeys

func (m *RSA) GenerateKeys() error

===================================================================================================================== Creating Keys =====================================================================================================================

func (*RSA) GetPubKeyFromPriKey

func (m *RSA) GetPubKeyFromPriKey() (err error)

func (*RSA) Reset

func (m *RSA) Reset()

Jump to

Keyboard shortcuts

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