---
name: "libressl-EVP_aes_128_cbc"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-EVP_aes_128_cbc"
---

# libressl-EVP\_aes\_128\_cbc(3)

EVP AES cipher

## NAME

**EVP\_aes\_128\_cbc**, **EVP\_aes\_192\_cbc**, **EVP\_aes\_256\_cbc**, **EVP\_aes\_128\_cfb1**, **EVP\_aes\_192\_cfb1**, **EVP\_aes\_256\_cfb1**, **EVP\_aes\_128\_cfb8**, **EVP\_aes\_192\_cfb8**, **EVP\_aes\_256\_cfb8**, **EVP\_aes\_128\_cfb128**, **EVP\_aes\_192\_cfb128**, **EVP\_aes\_256\_cfb128**, **EVP\_aes\_128\_cfb**, **EVP\_aes\_192\_cfb**, **EVP\_aes\_256\_cfb**, **EVP\_aes\_128\_ctr**, **EVP\_aes\_192\_ctr**, **EVP\_aes\_256\_ctr**, **EVP\_aes\_128\_ecb**, **EVP\_aes\_192\_ecb**, **EVP\_aes\_256\_ecb**, **EVP\_aes\_128\_ofb**, **EVP\_aes\_192\_ofb**, **EVP\_aes\_256\_ofb**, **EVP\_aes\_128\_cbc\_hmac\_sha1**, **EVP\_aes\_256\_cbc\_hmac\_sha1**, **EVP\_aes\_128\_wrap**, **EVP\_aes\_192\_wrap**, **EVP\_aes\_256\_wrap**, **EVP\_aes\_128\_xts**, **EVP\_aes\_256\_xts** – EVP AES cipher

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/evp.h\>**

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cbc**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_cbc**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cbc**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cfb1**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_cfb1**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cfb1**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cfb8**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_cfb8**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cfb8**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cfb128**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_cfb128**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cfb128**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cfb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_cfb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cfb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_ctr**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_ctr**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_ctr**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_ecb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_ecb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_ecb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_ofb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_ofb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_ofb**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_cbc\_hmac\_sha1**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_cbc\_hmac\_sha1**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_wrap**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_192\_wrap**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_wrap**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_128\_xts**(*void*);

*const* *EVP\_CIPHER* *\**\

**EVP\_aes\_256\_xts**(*void*);

## DESCRIPTION

These functions provide the AES encryption algorithm in the evp(3) framework. AES is a family of block ciphers operating on 128 bit blocks using key lengths of 128, 192, and 256 bits.

**EVP\_aes\_128\_cbc**(), **EVP\_aes\_192\_cbc**(), **EVP\_aes\_256\_cbc**(), **EVP\_aes\_128\_cfb1**(), **EVP\_aes\_192\_cfb1**(), **EVP\_aes\_256\_cfb1**(), **EVP\_aes\_128\_cfb8**(), **EVP\_aes\_192\_cfb8**(), **EVP\_aes\_256\_cfb8**(), **EVP\_aes\_128\_cfb128**(), **EVP\_aes\_192\_cfb128**(), **EVP\_aes\_256\_cfb128**(), **EVP\_aes\_128\_ctr**(), **EVP\_aes\_192\_ctr**(), **EVP\_aes\_256\_ctr**(), **EVP\_aes\_128\_ecb**(), **EVP\_aes\_192\_ecb**(), **EVP\_aes\_256\_ecb**(), **EVP\_aes\_128\_ofb**(), **EVP\_aes\_192\_ofb**(), and **EVP\_aes\_256\_ofb**() provide AES for 128, 192, and 256-bit keys in the following modes: CBC, CFB with 1-bit shift, CFB with 8-bit shift, CFB with 128-bit shift, CTR, ECB, and OFB.

**EVP\_aes\_128\_cfb**(), **EVP\_aes\_192\_cfb**(), and **EVP\_aes\_256\_cfb**() are aliases for **EVP\_aes\_128\_cfb128**(), **EVP\_aes\_192\_cfb128**(), and **EVP\_aes\_256\_cfb128**(), implemented as macros.

**EVP\_aes\_128\_cbc\_hmac\_sha1**() and **EVP\_aes\_256\_cbc\_hmac\_sha1**() provide authenticated encryption with AES in CBC mode using SHA-1 as HMAC, with keys of 128 and 256-bit length respectively. The authentication tag is 160 bits long. This is not intended for usage outside of TLS and requires calling of some undocumented control functions. These ciphers do not conform to the EVP AEAD interface.

**EVP\_aes\_128\_wrap**(), **EVP\_aes\_192\_wrap**(), and **EVP\_aes\_256\_wrap**() provide AES key wrap with 128, 192 and 256-bit keys according to RFC 3394 section 2.2.1 ("wrap"). When the returned *EVP\_CIPHER* object is later passed to EVP\_CipherInit\_ex(3), EVP\_EncryptInit\_ex(3), or EVP\_DecryptInit\_ex(3) together with an *EVP\_CIPHER\_CTX* object, the flag EVP\_CIPHER\_CTX\_FLAG\_WRAP\_ALLOW must have been set in the *EVP\_CIPHER\_CTX* using EVP\_CIPHER\_CTX\_set\_flags(3). Otherwise, or when passing the returned *EVP\_CIPHER* object to EVP\_CipherInit(3), EVP\_EncryptInit(3), or EVP\_DecryptInit(3), initialization fails with a “wrap not allowed” error.

**EVP\_aes\_128\_xts**() and **EVP\_aes\_256\_xts**() provide XEX-based tweaked-codebook mode with ciphertext stealing (XTS-AES) as specified in IEEE Std. 1619-2007 and described in NIST SP 800-38E. It was designed for encrypting data on a storage device, provides confidentiality but not authentication of data, and requires a key of double length for protection of a certain key size. In particular, XTS-AES-128 takes input of a 256-bit key to achieve AES 128-bit security, and XTS-AES-256 takes input of a 512-bit key to achieve AES 256-bit security.

## RETURN VALUES

These functions return an *EVP\_CIPHER* structure that provides the implementation of the symmetric cipher.

## SEE ALSO

AES\_encrypt(3), evp(3), EVP\_aes\_128\_ccm(3), EVP\_aes\_128\_gcm(3), EVP\_EncryptInit(3)

## HISTORY

**EVP\_aes\_128\_cbc**(), **EVP\_aes\_192\_cbc**(), **EVP\_aes\_256\_cbc**(), **EVP\_aes\_128\_cfb**(), **EVP\_aes\_192\_cfb**(), **EVP\_aes\_256\_cfb**(), **EVP\_aes\_128\_ebc**(), **EVP\_aes\_192\_ebc**(), **EVP\_aes\_256\_ebc**(), **EVP\_aes\_128\_ofb**(), **EVP\_aes\_192\_ofb**(), and **EVP\_aes\_256\_ofb**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

**EVP\_aes\_128\_cfb1**(), **EVP\_aes\_192\_cfb1**(), **EVP\_aes\_256\_cfb1**(), **EVP\_aes\_128\_cfb8**(), **EVP\_aes\_192\_cfb8**(), **EVP\_aes\_256\_cfb8**(), **EVP\_aes\_128\_cfb128**(), **EVP\_aes\_192\_cfb128**(), and **EVP\_aes\_256\_cfb128**() first appeared in OpenSSL 0.9.7e and have been available since OpenBSD 3.8.

**EVP\_aes\_128\_ctr**(), **EVP\_aes\_192\_ctr**(), **EVP\_aes\_256\_ctr**(), **EVP\_aes\_128\_cbc\_hmac\_sha1**(), **EVP\_aes\_256\_cbc\_hmac\_sha1**(), **EVP\_aes\_128\_xts**(), and **EVP\_aes\_256\_xts**() first appeared in OpenSSL 1.0.1 and have been available since OpenBSD 5.3.

**EVP\_aes\_128\_wrap**(), **EVP\_aes\_192\_wrap**(), and **EVP\_aes\_256\_wrap**() first appeared in OpenSSL 1.0.2 and have been available since OpenBSD 6.5.
