Documentation
¶
Index ¶
- func AesDecrypt(ciphertext, aesKey []byte) ([]byte, error)
- func AesEncrypt(clear, aesKey []byte) ([]byte, error)
- func DecryptFile(file string, outfile string, aesKey []byte) error
- func EncryptFile(clearfile string, outfile string, aesKey []byte) error
- func GenerateRandomBytes(count int) ([]byte, error)
- func GenerateSSLCert(certfile string, keyfile string, eccMode bool) error
- func GenerateSSLCertBytes(eccMode bool) ([]byte, []byte, error)
- func InitSSL(certfile string, keyfile string, useECC bool) error
- func Kdf(key []byte, label, salt []byte) ([]byte, error)
- func OpenAndDecrypt(filename string, fileType string, aesKey []byte) (vfs.VFS, error)
- func Pkcs7Pad(data []byte, blocklen int) ([]byte, error)
- func Pkcs7Unpad(data []byte, blocklen int) ([]byte, error)
- func SaveAndEncrypt(fs vfs.VFS, outfile string, fileType string, aesKey []byte) error
- type KeyPair
- type PubKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt : Decrypt some bytes with a given key using AES-CBC-aes.BlockSize
func AesEncrypt ¶
AesEncrypt : Encrypt some bytes with a given key using AES-CBC-aes.BlockSize
func DecryptFile ¶
DecryptFile will decrypt file with aesKey
func EncryptFile ¶
EncryptFile will encrypt clearfile with aesKey and save it to outfile
func GenerateRandomBytes ¶
GenerateRandomBytes : Generates as many random bytes as you ask for, returns them as []byte
func GenerateSSLCert ¶
GenerateSSLCert : Generate you some SSL cert/key
func GenerateSSLCertBytes ¶
GenerateSSLCertBytes : Generate you some SSL cert/key bytes
func OpenAndDecrypt ¶
OpenAndDecrypt returns an in-memory VFS initialized with the contents of the given filename, which will be decrypted with the given AES key,
and which must have one of the following fileTypes: - .zip - .tar - .tar.gz - .tar.bz2
func Pkcs7Unpad ¶
Pkcs7Unpad : Returns slice of the original data without padding.
Types ¶
type KeyPair ¶
type KeyPair interface { GenerateKey() Precompute() ToB64() string FromB64(s string) error EncryptMessage(clear []byte, pubkey PubKey) ([]byte, error) DecryptMessage(data []byte) (bool, []byte, error) GetName() string GetPubKey() PubKey ValidatePubKey(s string) bool Clone() KeyPair }
KeyPair : Interface to implement to make a bencrypt-compatable cryptosystem