encryption

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

func DecryptFile

func DecryptFile(encryptedFileName string, plainTextFileName string, key []byte)

DecryptFile decrypts an encrypted file to a plain text file.

func DeriveKey

func DeriveKey(password, salt []byte) ([]byte, []byte, error)

func Encrypt

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

func EncryptFile

func EncryptFile(plainTextFileName string, encryptedFileName string, key []byte)

EncryptFile encrypts a plain text file to an encrypted file.

func ExampleForEncryptionWithPassword

func ExampleForEncryptionWithPassword()

func GetKeyFromFile

func GetKeyFromFile(keyFileName string) []byte

GetKeyFromFile reads the content of a file as a key. The key should be 16 bytes (AES-128), 24 bytes (AES-192) or 32 bytes (AES-256).

Types

This section is empty.

Jump to

Keyboard shortcuts

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