kit

package
v0.0.0-...-3ec35c9 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const Extension = ".encrypt"

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(ciphertext, key []byte) ([]byte, error)

aes-cbc decrypt

func AESCBCEncrypt

func AESCBCEncrypt(plaintext, key []byte) ([]byte, error)

aes-cbc encrypt

func AESCFBDecrypt

func AESCFBDecrypt(path, password string, rename bool) error

aes-cfb decrypt

func AESCFBEncrypt

func AESCFBEncrypt(path, password string, rename bool) error

aes-cfb encrypt

func AESGCMDecrypt

func AESGCMDecrypt(ciphertext, key []byte) ([]byte, error)

aes-gcm decrypt

func AESGCMEncrypt

func AESGCMEncrypt(plaintext, key []byte) ([]byte, error)

aes-gcm encrypt

func Base64Decode

func Base64Decode(data string) ([]byte, error)

Base64 decode

func Base64Encode

func Base64Encode(data []byte) string

Base64 encode

func CheckErr

func CheckErr(err error)

func DecodePrivateKey

func DecodePrivateKey(key []byte) (*rsa.PrivateKey, error)

Decode Key

func Generate

func Generate(bits int) (*rsa.PrivateKey, error)

Generate new RSA keypair

func GetBasePath

func GetBasePath(path string) string

func GetFileName

func GetFileName(path string) string

func GetInput

func GetInput(s string) string

func GetPassword

func GetPassword() []byte

func HmacSha1

func HmacSha1(publicKey, privateKey string) []byte

HmacSha1

func HmacSha256

func HmacSha256(publicKey, privateKey string) []byte

HmacSha256

func Md532

func Md532(data string) []byte

MD5-32

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(plaintext []byte) []byte

func Pbkdf2Sha256

func Pbkdf2Sha256(data, salt string, iterations int) string

Pbkdf2Sha256

func RSADecrypt

func RSADecrypt(source []byte, privateKey []byte) ([]byte, error)

RSA decrypt

func RSAEncrypt

func RSAEncrypt(source []byte, publicKey []byte) ([]byte, error)

RSA encrypt

func RSASign

func RSASign(origdata string, privateKey []byte) (string, error)

RSA sign

func RSAVerify

func RSAVerify(origdata, ciphertext string, publicKey []byte) (bool, error)

RSA verify

func SHA1

func SHA1(data string) []byte

SHA-1

func SHA256

func SHA256(data string) []byte

SHA-256

func SHA384

func SHA384(data string) []byte

SHA-384

func SHA512

func SHA512(data string) []byte

SHA-512

func SaveFile

func SaveFile(path string, data []byte) error

func SaveKey

func SaveKey(privateKey *rsa.PrivateKey) error

func ScanFile

func ScanFile(path string) (*list.List, error)

func Stringify

func Stringify(privateKey *rsa.PrivateKey) (string, string, error)

func ValidateFile

func ValidateFile(file string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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