crypto

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

A module to help with cryptographic requirements like encryption and hashing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptB64ToBytes

func DecryptB64ToBytes(data string) (decryptedData []byte, err error)

Decrypt a base64-encoded encrypted string to unencrypted bytes

This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func and returns resultant byte array.

func DecryptB64ToBytesWithDataKey

func DecryptB64ToBytesWithDataKey(data string, dataKey string, clientId string) (decryptedData []byte, err error)

Decrypt a base64-encoded encrypted string to unencrypted bytes

This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func and returns resultant byte array.

func DecryptB64ToString

func DecryptB64ToString(data string) (decryptedString string, err error)

Decrypt a base64-encoded encrypted string to unencrypted string

This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func, converts the result into a string and returns resultant string. Note: Only use when string data was encrypted.

func DecryptB64ToStringWithDataKey

func DecryptB64ToStringWithDataKey(data string, dataKey string, clientId string) (decryptedString string, err error)

Decrypt a base64-encoded encrypted string to unencrypted string

This function accepts an incoming base64 encoded string, base64 decodes it, decrypts it using EncryptBytes func, converts the result into a string and returns resultant string. Note: Only use when string data was encrypted.

func DecryptBytes

func DecryptBytes(cipherData []byte) (data []byte, err error)

Decrypt a byte array Deprecated - to be removed in future releases - use DecryptBytesWithDataKey instead

This function accepts an incoming byte array, decrypts it using AES-256 decryption and returns the result in bytes

func DecryptBytesWithDataKey

func DecryptBytesWithDataKey(cipherData []byte, dataKey string, clientId string) (data []byte, err error)

Decrypt a byte array

This function accepts an incoming byte array, decrypts it using AES-256 decryption and returns the result in bytes

func DecryptString

func DecryptString(data []byte) (stringData string, err error)

Decrypt a byte array

This function accepts an incoming byte array, decrypts it using AES-256 decryption, converts the result into a string and returns the string

func DecryptStringWithDataKey

func DecryptStringWithDataKey(data []byte, dataKey string, clientId string) (stringData string, err error)

Decrypt a byte array

This function accepts an incoming byte array, decrypts it using AES-256 decryption, converts the result into a string and returns the string

func EncryptBytes

func EncryptBytes(data []byte) (encryptedBytes []byte, err error)

Encrypt a byte array Deprecated - to be removed in future releases - use EncryptBytesWithDataKey instead

This function accepts an incoming byte array, encrypts it using AES-256 decryption and returns the result in bytes

func EncryptBytesWithDataKey

func EncryptBytesWithDataKey(data []byte, dataKey string, clientId string) (encryptedBytes []byte, err error)

Encrypt a byte array

This function accepts an incoming byte array, encrypts it using AES-256 decryption and returns the result in bytes

func EncryptString

func EncryptString(data string) (byteData []byte, err error)

Encrypt a byte array

This function accepts an incoming string, encrypts it using EncryptBytes func and returns the result in bytes

func EncryptStringWithDataKey

func EncryptStringWithDataKey(data string, dataKey string, clientId string) (byteData []byte, err error)

Encrypt a byte array

This function accepts an incoming string, encrypts it using EncryptBytes func and returns the result in bytes.

func EncryptToB64String

func EncryptToB64String(data string) (encryptedDataB64Str string, err error)

Encrypt a string

This function accepts an incoming string, encrypts it using EncryptBytes func, encodes the bytearray to base64 string and returns the resultant string

func EncryptToB64StringWithDataKey

func EncryptToB64StringWithDataKey(data string, dataKey string, clientId string) (encryptedDataB64Str string, err error)

Encrypt a string

This function accepts an incoming string, encrypts it using EncryptBytes func, encodes the bytearray to base64 string and returns the resultant string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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