aes v1

This package provides functions to encrypt and decrypt data using AES encryption. It supports both byte slices and strings as input and output formats.

Repository

Installation

Usage

String Encryption/Decryption

Byte Slice Encryption/Decryption

Working with Base64 Encoding

API Reference

Encryption Methods

  • BytesToBytes(src []byte, key string) []byte

    • Encrypts a byte slice and returns encrypted bytes

  • BytesToString(src []byte, key string) string

    • Encrypts a byte slice and returns encrypted string

  • BytesToBase64(src []byte, key string) string

    • Encrypts a byte slice and returns base64 encoded string

  • StringToBytes(str, key string) []byte

    • Encrypts a string and returns encrypted bytes

  • StringToString(str, key string) string

    • Encrypts a string and returns encrypted string

  • StringToBase64(str, key string) string

    • Encrypts a string and returns base64 encoded string

Decryption Methods

  • BytesToBytes(src []byte, key string) []byte

    • Decrypts encrypted bytes and returns original bytes

  • BytesToString(src []byte, key string) string

    • Decrypts encrypted bytes and returns original string

  • StringToBytes(encrypted string, key string) []byte

    • Decrypts encrypted string and returns original bytes

  • StringToString(encrypted string, key string) string

    • Decrypts encrypted string and returns original string

  • Base64ToBytes(src string, key string) []byte

    • Decrypts base64 encoded string and returns original bytes

  • Base64ToString(encrypted string, key string) string

    • Decrypts base64 encoded string and returns original

Last updated