ciphered

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ciphered provides functions for encoding and decoding strings using AES, gzip compression and base64 encoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(input string) (result string, err error)

Decode the input string using base64 decoding followed by gzip decompression, and returns the resulting string. If any error occurs during decoding or decompression, it returns an empty string and the corresponding error.

func Decrypt

func Decrypt(ciphertext string, key32 []byte) (plaintext string, err error)

Decrypt a variable-length string using AES-GCM

func DecryptFixed

func DecryptFixed(encodedCipherText string, random bool, fixKey []byte) (plaintext string, err error)

DecryptFixed decrypts an encrypted string using AES encryption.

func Encode

func Encode(input string) (result string, err error)

Encode the input string using gzip compression followed by base64 encoding, and returns the resulting encoded string.

func Encrypt

func Encrypt(plaintext string, key32 []byte) (ciphertext string, err error)

Encrypt a variable-length string using AES-GCM

func EncryptFixed

func EncryptFixed(plainText string, random bool, fixKey []byte) (encodedCipherText string, err error)

EncryptFixed encrypts a fixed-length string using AES encryption.

func PadPKCS7

func PadPKCS7(data []byte, blockSize int) []byte

func UnpadPKCS7

func UnpadPKCS7(data []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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