func AesCbcEncrypt(plainText, secretKey, iv []byte) ([]byte, error) {
	block, err := aes.NewCipher(secretKey) // NewCipher The function limits the length of the input k to 16,24 or 32
	if err != nil {
		return nil, err
	}
	blockSize := block.BlockSize()                 // gets the length of the block of the secret key
	plainText = PKCS7Padding(plainText, blockSize) // the completion code 补全码
	blockMode := cipher.NewCBCEncrypter(block, iv) // encryption mode
	crypt := make([]byte, len(plainText))          // create array
	blockMode.CryptBlocks(crypt, plainText)        // encode
	return []byte(base64.StdEncoding.EncodeToString(crypt)), nil
}
// AesCbcEncrypt aes cbc encrypt , The most common method of aes encryption
AesCbcEncrypt aes cbc encrypt , The most common method of aes encryption
// AesCbcEncrypt aes cbc encrypt The most common method of aes encryption
func AesCbcEncrypt(plainText, secretKey, iv []byte) ([]byte, error) {
	block, err := aes.NewCipher(secretKey) 
	if err != nil {
		return nil, err
	}
	blockSize := block.BlockSize()                 
	plainText = PKCS7Padding(plainText, blockSize) 
	blockMode := cipher.NewCBCEncrypter(block, iv) 
	crypt := make([]byte, len(plainText))          
	blockMode.CryptBlocks(crypt, plainText)        
	return []byte(base64.StdEncoding.EncodeToString(crypt)), nil
}
func AesCbcEncrypt ( plainText , secretKey , iv [ ] byte ) ( [ ] byte , error ) { block , err := aes . NewCipher ( secretKey ) if err != nil { return nil , err } blockSize := block . BlockSize ( ) plainText = PKCS7Padding ( plainText , blockSize ) blockMode := cipher . NewCBCEncrypter ( block , iv ) crypt := make ( [ ] byte , len ( plainText ) ) blockMode . CryptBlocks ( crypt , plainText ) return [ ] byte ( base64 . StdEncoding . EncodeToString ( crypt ) ) , nil }
AesCbcEncrypt aes cbc encrypt , The most common method of aes encryption
AesCbcEncrypt aes cbc encrypt The most common method of aes encryption
// NewCipher The function limits the length of the input k to 16,24 or 32 // gets the length of the block of the secret key // the completion code 补全码 // encryption mode // create array // encode