Documentation ¶
Overview ¶
Package ciphered provides functions for encoding and decoding strings using AES, gzip compression and base64 encoding.
Index ¶
- func Decode(input string) (result string, err error)
- func Decrypt(ciphertext string, key32 []byte) (plaintext string, err error)
- func DecryptFixed(encodedCipherText string, random bool, fixKey []byte) (plaintext string, err error)
- func Encode(input string) (result string, err error)
- func Encrypt(plaintext string, key32 []byte) (ciphertext string, err error)
- func EncryptFixed(plainText string, random bool, fixKey []byte) (encodedCipherText string, err error)
- func PadPKCS7(data []byte, blockSize int) []byte
- func UnpadPKCS7(data []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
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 DecryptFixed ¶
func DecryptFixed(encodedCipherText string, random bool, fixKey []byte) (plaintext string, err error)
DecryptFixed decrypts an encrypted string using AES encryption.
func Encode ¶
Encode the input string using gzip compression followed by base64 encoding, and returns the resulting encoded string.
func EncryptFixed ¶
func EncryptFixed(plainText string, random bool, fixKey []byte) (encodedCipherText string, err error)
EncryptFixed encrypts a fixed-length string using AES encryption.
func UnpadPKCS7 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.