func SymmetricDecrypt(IV [aes.BlockSize]byte, key, cipherText []byte) []byte {
	plainText := make([]byte, len(cipherText), len(cipherText))
	if len(key) == 25 {
		key = append(key, make([]byte, 7, 7)...)
	}
	block, _ := aes.NewCipher(key)
	mode := cipher.NewCBCDecrypter(block, IV[:])
	plainText = make([]byte, len(cipherText), len(cipherText))
	mode.CryptBlocks(plainText, cipherText[:])
	return plainText
}
Decrypted cipherText encrypted with AES-256 using the given IV and key.
package encryption
import (
	"crypto/aes"
	"crypto/cipher"
	"crypto/rand"
	"fmt"
)
func SymmetricEncrypt(key []byte, plainText string) ([aes.BlockSize]byte, []byte, error) {
	var IV [aes.BlockSize]byte
	n, err := rand.Reader.Read(IV[:])
	if err != nil || n != 16 {
		return IV, nil, err
	}
	plainBytes := []byte(plainText)
	pad_len := aes.BlockSize - (len(plainBytes) % aes.BlockSize)
	padding := make([]byte, pad_len, pad_len)
	plainBytes = append(plainBytes, padding...)
	if len(key) == 25 {
		key = append(key, make([]byte, 7, 7)...)
	}
	block, err := aes.NewCipher(key)
	if err != nil {
		fmt.Println("Uh Oh: ", err)
		return IV, nil, err
	}
	mode := cipher.NewCBCEncrypter(block, IV[:])
	cipherText := make([]byte, len(plainBytes), len(plainBytes))
	mode.CryptBlocks(cipherText, plainBytes)
	return IV, cipherText, nil
}