crypt

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptDataWithClientPrivateKey

func DecryptDataWithClientPrivateKey(data, key []byte, keyPassword string) ([]byte, error)

DecryptDataWithClientPrivateKey decrypts provided byte slice with provided client private key

func DesDecrypt added in v1.0.0

func DesDecrypt(src, key []byte) ([]byte, error)

DesDecrypt implements DES decryption in ECB mode with PKCS padding

func DesEncrypt added in v1.0.0

func DesEncrypt(src, key []byte) ([]byte, error)

DesEncrypt implements DES encryption in ECB mode with PKCS padding

func EncryptDataWithServerPubKey

func EncryptDataWithServerPubKey(data, key []byte) ([]byte, error)

EncryptDataWithServerPubKey encrypts provided byte slice with provided server public key

func GeneratePrivateKeySignature

func GeneratePrivateKeySignature(data, key []byte, keyPassword string) ([]byte, error)

GeneratePrivateKeySignature creates private key signature

func PKCS5Padding added in v1.0.0

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

PKCS5Padding implements PKCS padding

func PKCS5UnPadding added in v1.0.0

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding implements PKCS unpadding

func RandString added in v1.0.0

func RandString(length int) string

RandString creates random string of specified length

Types

This section is empty.

Jump to

Keyboard shortcuts

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