crypto

package
v0.0.0-...-71a597d Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressAndEncryptFile

func CompressAndEncryptFile(filePath string, newFilePath string, sharedKey string)

Encrypt given file using the shared key

func DecryptAndDecompressFile

func DecryptAndDecompressFile(filePath string, newFilePath string, sharedKey string)

Decrypt given file using the shared key

func DecryptFiles

func DecryptFiles(dir string, sharedKey string)

Decrypt files in given directory using shared key

func DecryptKey

func DecryptKey(encryptedKey []byte, privateKey *rsa.PrivateKey) string

Decrypt shared key using private RSA key

func EncryptFiles

func EncryptFiles(dir string, sharedKey string)

Encrypt files in given directory using shared key

func EncryptKey

func EncryptKey(sharedKey string, recvPubKey *rsa.PublicKey) []byte

Encrypt shared key with received public key

func GenerateRSAKeypair

func GenerateRSAKeypair() (*rsa.PrivateKey, *rsa.PublicKey)

Generate RSA keypair

func GetKey

func GetKey(sender *transfer.Sender) []byte

Get public key from sender

func ReceiverKeyExchange

func ReceiverKeyExchange(key *rsa.PublicKey) string

Exchange keys with sender

func SenderKeyExchange

func SenderKeyExchange(receiverIP string) *rsa.PublicKey

Exchange keys with receiver

Types

This section is empty.

Jump to

Keyboard shortcuts

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