encryption

package
v0.0.0-...-4d0e4ef Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aes256

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

Aes256 encrypts the data with the key and returns the encrypted data and IV.

func BytesToHexArray

func BytesToHexArray(shellCode []byte) string

BytesToHexArray converts a byte slice to a string of hex values.

func DecryptAES

func DecryptAES(key, iv, ciphertext []byte) ([]byte, error)

DecryptAES decrypts a ciphertext using the given key and IV The ciphertext must be a multiple of the block size

func EncryptPayload

func EncryptPayload(key string, payload []byte) ([]byte, []byte, []byte, bool)

EncryptPayload encrypts the payload with the key and returns the encrypted payload, IV, and key.

func ReadFileAndExtractComponents

func ReadFileAndExtractComponents(filePath string) ([]byte, []byte, []byte, error)

ReadFileAndExtractComponents reads data from the file, extracts the key, IV, and payload. useful for getting the key and IV to decrypt.

func ReadFileWithoutComponents

func ReadFileWithoutComponents(filePath string) ([]byte, error)

ReadFileWithoutComponents reads data from the file without extracting the key, IV, and payload. useful for getting the payload to encrypt.

func ReadPayloadToFile

func ReadPayloadToFile(filepath string, data []byte) (bool, error)

ReadPayloadToFile writes the payload to a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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