encryption

package
v0.0.0-...-e8674d7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, secretKey string) (decoded []byte, err error)

Decrypt decrypts the given encrypted data using the specified secret key.

Parameters: - data: Encrypted data to be decrypted. - secretKey: Secret key used for decryption.

Returns: - decoded: Decrypted data. - err: Error, if any, encountered during the decryption process.

Example Usage: decryptedData, err := Decrypt(encryptedData, "yourSecretKey")

if err != nil {
    fmt.Println("Decryption failed:", err)
    return
}

fmt.Println("Decryption successful. Decrypted Data:", decryptedData)

func Encrypt

func Encrypt(data []byte, secretKey string) (encoded []byte, err error)

Encrypt encrypts the given data using the specified secret key.

Parameters: - data: Data to be encrypted. - secretKey: Secret key used for encryption.

Returns: - encoded: Encrypted data. - err: Error, if any, encountered during the encryption process.

Example Usage: encryptedData, err := Encrypt(originalData, "yourSecretKey")

if err != nil {
    fmt.Println("Encryption failed:", err)
    return
}

fmt.Println("Encryption successful. Encrypted Data:", encryptedData)

Types

This section is empty.

Jump to

Keyboard shortcuts

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