xcrypto

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AesCbc256B64 ..
	AesCbc256B64 = iota
	// AesCbc128HmacSha256B64 ..
	AesCbc128HmacSha256B64
	// AesCbc256HmacSha256B64 ..
	AesCbc256HmacSha256B64
	// Rsa2048OaepSha256B64 ..
	Rsa2048OaepSha256B64
	// Rsa2048OaepSha1B64 ..
	Rsa2048OaepSha1B64
	// Rsa2048OaepSha256HmacSha256B64 ..
	Rsa2048OaepSha256HmacSha256B64
	// Rsa2048OaepSha1HmacSha256B64 ..
	Rsa2048OaepSha1HmacSha256B64
)

Variables

This section is empty.

Functions

func DecryptStruct

func DecryptStruct(data interface{}, key CryptoKey) error

DecryptStruct ...

func DecryptStructWithXRsa

func DecryptStructWithXRsa(data interface{}, xr *xrsa.XRsa) error

DecryptStructWithXRsa ...

func EncryptStruct

func EncryptStruct(data interface{}, key CryptoKey) error

EncryptStruct ..

func EncryptStructWithXRsa

func EncryptStructWithXRsa(data interface{}, xr *xrsa.XRsa) error

EncryptStructWithXRsa ..

func MakePassworkHash

func MakePassworkHash(password string, key CryptoKey) string

MakePassworkHash ..

Types

type CipherString

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

CipherString ..

func Encrypt

func Encrypt(pt []byte, key CryptoKey) (*CipherString, error)

Encrypt ..

func MakeEncKey

func MakeEncKey(key []byte) (*CipherString, error)

MakeEncKey ..

func NewCipherString

func NewCipherString(encryptedString string) (*CipherString, error)

NewCipherString ..

func NewCipherStringRaw

func NewCipherStringRaw(encryptionType int, ct string, iv string, mac string) (*CipherString, error)

NewCipherStringRaw ..

func (*CipherString) Decrypt

func (cs *CipherString) Decrypt(key CryptoKey) ([]byte, error)

Decrypt ..

func (*CipherString) DecryptKey

func (cs *CipherString) DecryptKey(key CryptoKey, encryptionType int) (CryptoKey, error)

DecryptKey ..

func (*CipherString) ToString

func (cs *CipherString) ToString() string

ToString ..

type CryptoKey

type CryptoKey struct {
	EncKey         []byte
	MacKey         []byte
	EncryptionType int
}

CryptoKey ..

func MakeKey

func MakeKey(password string, salt string) CryptoKey

MakeKey ..

func NewCryptoKey

func NewCryptoKey(key []byte, encryptionType int) (CryptoKey, error)

NewCryptoKey ..

Jump to

Keyboard shortcuts

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