func AESCBCEncrypt(key, iv, plainText []byte) ([]byte, error) {
	block, err := aes.NewCipher(key)
	if err != nil {
		panic(err)
	}

	mode := cipher.NewCBCEncrypter(block, iv)
	if len(plainText)%aes.BlockSize != 0 {
		plainText = pkcs5Padding(plainText, block.BlockSize())
	}
	ciphertext := make([]byte, len(plainText))
	mode.CryptBlocks(ciphertext, plainText)

	return ciphertext, nil

}
// AESCBCEncrypt is given key, iv to encrypt the plainText in AES CBC way.
AESCBCEncrypt is given key, iv to encrypt the plainText in AES CBC way.
// AESCBCEncrypt is given key iv to encrypt the plainText in AES CBC way .
func AESCBCEncrypt(key, iv, plainText []byte) ([]byte, error) {
	block, err := aes.NewCipher(key)
	if err != nil {
		panic(err)
	}
	mode := cipher.NewCBCEncrypter(block, iv)
	if len(plainText)%aes.BlockSize != 0 {
		plainText = pkcs5Padding(plainText, block.BlockSize())
	}
	ciphertext := make([]byte, len(plainText))
	mode.CryptBlocks(ciphertext, plainText)
	return ciphertext, nil
}
func AESCBCEncrypt ( key , iv , plainText [ ] byte ) ( [ ] byte , error ) { block , err := aes . NewCipher ( key ) if err != nil { panic ( err ) } mode := cipher . NewCBCEncrypter ( block , iv ) if len ( plainText ) % aes . BlockSize != 0 { plainText = pkcs5Padding ( plainText , block . BlockSize ( ) ) } ciphertext := make ( [ ] byte , len ( plainText ) ) mode . CryptBlocks ( ciphertext , plainText ) return ciphertext , nil }
AESCBCEncrypt is given key, iv to encrypt the plainText in AES CBC way.
AESCBCEncrypt is given key iv to encrypt the plainText in AES CBC way .