encription

package
v0.0.0-...-66c81c8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptItem

func AESDecryptItem(location string, rename string, keyString []byte, nonce []byte) error

Ecnrypts file at location given using private key path

func AESEncryptionItem

func AESEncryptionItem(location string, rename string, keyString string) ([]byte, error)

Ecnrypts file at location given using private key path

func BytesToPrivateKey

func BytesToPrivateKey(priv []byte) *rsa.PrivateKey

BytesToPrivateKey bytes to private key

func BytesToPublicKey

func BytesToPublicKey(pub []byte) *rsa.PublicKey

BytesToPublicKey bytes to public key

func Compress

func Compress(path string, name string) error

Compresses directory or folder into .tar.xz

func CreatePrivateEncryptFile

func CreatePrivateEncryptFile(privateKey *rsa.PrivateKey) error

Creates the private key text file for the user

func Decompress

func Decompress(path string) error

Decompresses directory or folder and returns it to original state

func DecryptWithPrivateKey

func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)

DecryptWithPrivateKey decrypts data with private key

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

EncryptWithPublicKey encrypts data with public key

func GenerateKeyPair

func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)

GenerateKeyPair generates a new key pair

func PrivateKeyToBytes

func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte

PrivateKeyToBytes private key to bytes

func PublicKeyToBytes

func PublicKeyToBytes(pub *rsa.PublicKey) []byte

PublicKeyToBytes public key to bytes

func RSADecryptItem

func RSADecryptItem(keypath string, aes []byte, nonce []byte) ([]byte, []byte, error)

Decrypts file at location given using private key path

func RSAEncryptItem

func RSAEncryptItem(key string, publickey []byte, nonce []byte) ([]byte, []byte, error)

Encrypts location given using public key as a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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