AES Encryption and Decryption

Encrypt or decrypt text in your browser with AES - fully configurable.

Tool

Encrypt / Decrypt

Use the AES settings panel to enter source text, choose encodings and AES settings, then press Encrypt or Decrypt to show the result.

Input text

Output text

This tool is for educational and testing purposes only. Do not use it with sensitive, confidential, or production data.

Overview

What this tool does

This browser-based AES tool encrypts or decrypts text with configurable input and output encoding, key size, AES mode, padding, key derivation type, hash function, salt, and iteration count. It is designed for learning, quick verification, and testing how different settings affect AES output.

A practical starting point for testing is UTF-8 input, HEX output, AES-128, CBC, Pkcs7, PBKDF2, and SHA256.

How To

How to use this tool

  1. 1

    Enter input text

    Type or paste the text you want to encrypt or decrypt in the input area.

  2. 2

    Select the input encoding

    Choose UTF-8, HEX, or Base64 so the tool can parse the source value correctly.

  3. 3

    Configure AES settings

    Set output encoding, key size, AES mode, padding, key derivation type, hash function, and optional passphrase, salt, or iteration values.

  4. 4

    Encrypt or decrypt

    Press Encrypt to create ciphertext or Decrypt to recover plaintext from HEX or Base64 input.

  5. 5

    Review the result

    Check the output text and configuration summary in the result area.

  6. 6

    Adjust HEX output case

    If the output encoding is HEX, use the upper-case or lower-case button to normalize the output.

Guide

Complete guide to AES encryption and decryption

Thumbnail image for the cryptography aes.

Understanding AES encryption

The Advanced Encryption Standard (AES) is a symmetric block cipher standardized by the U.S. National Institute of Standards and Technology (NIST) in Federal Information Processing Standard (FIPS) 197, published in 2001. AES is a subset of the Rijndael cipher developed by Belgian cryptographers Joan Daemen and Vincent Rijmen, and it was selected through a public, international competition organized by NIST. The algorithm operates on 128-bit blocks and supports key sizes of 128, 192, and 256 bits, with corresponding round counts of 10, 12, and 14.

As a symmetric cipher, AES uses the same secret key for both encryption and decryption. Its internal structure is based on a substitution-permutation network (SPN), not a Feistel network. This design choice enables efficient hardware and software implementations. Each round in AES consists of four transformations: SubBytes (nonlinear byte substitution using an S-box), ShiftRows (transposition of the state matrix), MixColumns (mixing operation on columns), and AddRoundKey (XOR with the round key derived from the cipher key via the key schedule). The final round omits the MixColumns step. According to the NIST Special Publication 800-38A, AES can be used with various modes of operation to provide confidentiality, authentication, or both depending on the application requirements.

AES key sizes and round counts

The security strength of AES scales directly with key size. A larger key provides exponentially more possible values, making brute-force attacks computationally infeasible. The table below summarizes the relationship between key size, number of rounds, and practical security level.

Key size (bits) Number of rounds Block size (bits) Security level Recommended use
AES-128 10 128 128-bit General-purpose encryption, fast performance
AES-192 12 128 192-bit Higher-security environments, moderate overhead
AES-256 14 128 256-bit Top-secret classification, maximum security margin

The National Security Agency (NSA) approves AES-128 for classified information up to SECRET level and AES-192 / AES-256 for TOP SECRET level, as documented in CNSS Policy No. 15 (Suite B cryptography).

AES vs DES vs Triple DES comparison

AES replaced the older Data Encryption Standard (DES) as the U.S. federal encryption standard in 2001. DES uses a 56-bit key and 64-bit blocks, making it highly vulnerable to modern brute-force attacks. Triple DES (3DES) extended DES by applying the algorithm three times with two or three independent keys, providing a moderate security improvement at the cost of significantly slower performance. AES was designed from the ground up to address these limitations, offering larger key sizes, larger block sizes, and dramatically faster throughput. The table below compares these three symmetric ciphers across key technical dimensions.

Feature DES Triple DES (3DES) AES
Key size 56 bits 112 or 168 bits 128, 192, or 256 bits
Block size 64 bits 64 bits 128 bits
Rounds 16 48 (3 × 16) 10, 12, or 14
Structure Feistel network Feistel network Substitution-permutation network
Security status Broken (deprecated) Deprecated (NIST SP 800-131A) Secure (current standard)
Relative speed Moderate Slow (3 × DES) Fast (hardware-accelerated)

NIST officially deprecated Triple DES (3DES) in 2023 and recommends AES for all new encryption deployments. While 3DES is still encountered in legacy financial systems, its 64-bit block size makes it vulnerable to birthday-bound attacks such as Sweet32. AES eliminates these weaknesses with its 128-bit block size and modern SPN design. For a detailed comparison of symmetric cipher security, refer to NIST SP 800-131A on cryptographic algorithm transitions.

AES block cipher modes comparison

AES itself is a block cipher that encrypts one 128-bit block at a time. To encrypt data longer than one block, a mode of operation must be applied. Each mode has distinct characteristics regarding parallelism, error propagation, and initialization vector (IV) requirements. The table below compares the five modes available in this tool.

Mode Requires IV Parallel encryption Parallel decryption Error propagation Best use case
CBC Yes No Yes Full block General-purpose block encryption
CFB Yes No Yes Segment size Stream-like data, partial segments
CTR Yes (nonce) Yes Yes None High-speed, parallel processing
OFB Yes No No None Noisy or unreliable channels
ECB No Yes Yes None Single-block data only (avoid for patterns)

ECB mode encrypts each block independently and can reveal repeating patterns in the plaintext. NIST SP 800-38A discourages the use of ECB for messages longer than one block due to this deterministic property. CBC, CTR, CFB, and OFB are generally preferred for multi-block data.

Common AES configuration profiles

Different security contexts call for different AES configurations. The table below presents four common profiles that illustrate how key size, mode, padding, and KDF choices are combined for typical real-world scenarios. Understanding these profiles helps you select the right settings for your own encryption needs.

Use case Key size Mode Padding KDF Rationale
General file encryption 256 CBC Pkcs7 PBKDF2 Maximum security with broad compatibility; CBC is widely supported
Performance-critical systems 128 CTR Pkcs7 PBKDF2 Fastest mode with parallel encryption; suitable for large data streams
Stream-like data 256 CFB Pkcs7 PBKDF2 Converts block cipher into self-synchronizing stream cipher
OpenSSL compatibility 256 CBC Pkcs7 EvpKDF Matches OpenSSL’s default enc command for cross-platform exchange

When choosing a configuration profile, consider both security requirements and interoperability. AES-256-CBC with PBKDF2 is the most universally compatible choice for exchanging encrypted data across different programming languages and platforms. For more guidance on selecting the right AES configuration for your application, see best practices for AES encryption mode selection and configuration.

Padding schemes

Because AES operates on fixed 128-bit blocks, plaintext that does not align to the block boundary must be padded before encryption. The two padding schemes available in this tool are widely used in cryptographic standards.

Padding scheme Description Standard / reference
Pkcs7 Adds N bytes each with value N, where N is the number of padding bytes needed (1 to 16). Always adds at least one byte. RFC 2315 (PKCS #7)
Iso97971 Appends a single 0x80 byte followed by zero bytes until the block boundary is reached. ISO/IEC 9797-1 Method 2

Pkcs7 is the default and most compatible padding for AES across cryptographic libraries. Iso97971 is an alternative defined in the ISO/IEC 9797-1 standard and is less commonly used in web-based tools.

Key derivation functions

AES requires a fixed-length binary key. When a passphrase is provided instead of a direct key, a key derivation function (KDF) transforms the passphrase into the required key material. This tool supports two KDFs: PBKDF2 and EvpKDF.

PBKDF2 (Password-Based Key Derivation Function 2) is defined in RFC 2898 (PKCS #5). It applies a pseudorandom function (such as HMAC-SHA256) repeatedly for a configurable number of iterations. The iteration count increases the computational cost of brute-force attacks. A cryptographic salt (random data) is combined with the passphrase to prevent precomputed dictionary (rainbow table) attacks. PBKDF2 is recommended by NIST SP 800-132 for password-based key derivation.

EvpKDF is an OpenSSL-compatible derivation method that uses a simpler iterative hashing approach based on MD5 by default. It is provided for compatibility with existing OpenSSL-encrypted data. For new encryption work, PBKDF2 with SHA256 and a sufficiently high iteration count (1000 or more) is the stronger choice.

Initialization vector

An initialization vector (IV) is a random or pseudorandom value used in modes such as CBC, CFB, CTR, and OFB. The IV ensures that encrypting the same plaintext multiple times produces different ciphertext outputs, preventing attackers from detecting repeated data patterns. The IV does not need to be secret, but it must be unique (or non-repeating) for each encryption operation under the same key. This tool generates a cryptographically random IV for every encryption and prepends it to the ciphertext so that decryption can recover it automatically.

Security considerations

  • Passphrase strength: Use a strong, unique passphrase with a mix of uppercase, lowercase, digits, and symbols. Weak passphrases negate the security benefits of AES regardless of key size.
  • Salt usage: A unique salt should be used for each encryption operation. The salt prevents precomputed lookup attacks (rainbow tables) and ensures that identical passphrases produce different keys.
  • Mode selection: Avoid ECB for multi-block plaintext because it leaks data patterns. Prefer CBC, CTR, CFB, or OFB for meaningful testing and learning.
  • IV uniqueness: Never reuse the same IV with the same key. Reusing an IV in CTR mode can completely break confidentiality.
  • Iteration count: Higher iteration values (e.g., 10000 or more) increase the work factor for brute-force attacks but also increase processing time. Choose a balance appropriate for your testing environment.
  • Encoding compatibility: Encryption does not support UTF-8 output, and decryption expects HEX or Base64 input. Use HEX or Base64 for the ciphertext representation.
  • Operational caution: This page runs entirely in the browser and is intended for learning, experimentation, and quick verification. Production systems should use audited cryptographic libraries, secure key management infrastructure, and professional security review.

AES performance characteristics by mode

The choice of AES mode of operation significantly affects encryption and decryption throughput, especially on modern processors with AES-NI hardware acceleration. The table below summarizes the relative performance characteristics of each mode available in this tool, based on typical benchmarks on x86-64 processors with hardware AES support. Understanding these trade-offs helps you select the optimal mode for your specific workload.

Mode Encryption throughput Decryption throughput AES-NI benefit Best suited for
CBC Moderate High (parallel) Significant General-purpose encryption with sequential writes
CFB Moderate Moderate Moderate Stream-like data with variable-length segments
CTR High (parallel) High (parallel) Maximum High-throughput systems, multi-core environments
OFB Low Low Limited Noisy or unreliable channels, error-sensitive links
ECB High (parallel) High (parallel) Maximum Single-block operations only (not for multi-block data)

Modern x86-64 and ARMv8 processors include dedicated AES instruction sets (AES-NI on Intel/AMD, ARMv8 Crypto Extensions on Apple Silicon and recent ARM CPUs) that accelerate the AES round transformations in hardware. CTR and ECB modes benefit most from this acceleration because their parallel nature allows multiple blocks to be processed simultaneously. For detailed performance benchmarks across different processor generations, see AES-NI hardware acceleration performance benchmarks and throughput analysis.

AES applications table

AES is embedded in countless security protocols and products across industries. The table below highlights major real-world applications of AES encryption.

Application domain Example use Typical key size Standard / protocol
Web security TLS/HTTPS data encryption 128, 256 TLS 1.2 / 1.3 (AES-GCM)
Wireless networks Wi-Fi data confidentiality 128 IEEE 802.11i (WPA2/WPA3)
Disk encryption Full-disk and file-level encryption 128, 256 BitLocker, FileVault, LUKS
Mobile communications Encrypted voice and messaging 128, 256 3GPP (LTE/5G) encryption
Government / military Classified data protection 192, 256 Suite B / CNSA (NSA-approved)

AES is the first and only publicly accessible cipher approved by the NSA for TOP SECRET classified information. Its widespread adoption across consumer, enterprise, and government systems makes it the most rigorously analyzed symmetric encryption algorithm in history. For an authoritative overview of AES applications, refer to the NIST overview of AES encryption standards and applications.

History of AES

The development of AES began in 1997 when NIST announced a public competition to replace the aging Data Encryption Standard (DES), whose 56-bit key had become vulnerable to brute-force attacks. Fifteen candidate algorithms were submitted from cryptography teams worldwide. After three rounds of rigorous public analysis and cryptanalysis, the Rijndael algorithm - designed by Belgian cryptographers Joan Daemen and Vincent Rijmen - was selected as the winner in October 2000 and officially published as FIPS 197 in November 2001.

The key milestones in AES history include:

  • 1997: NIST announces the Advanced Encryption Standard development effort and calls for candidate algorithms.
  • 1998: 15 candidate algorithms are submitted from 12 countries. NIST hosts the First AES Candidate Conference.
  • 1999: Five finalists are selected: MARS, RC6, Rijndael, Serpent, and Twofish.
  • 2000: Rijndael is announced as the winner on October 2, 2000.
  • 2001: FIPS 197 is published on November 26, 2001, officially standardizing AES.
  • 2002: AES becomes effective as a U.S. federal government standard.
  • 2003: NSA approves AES for classified information up to TOP SECRET.
  • Present: AES is embedded in TLS, IPsec, Wi-Fi (WPA2/WPA3), VPNs, disk encryption, mobile communications, and countless other security protocols worldwide.

For the complete historical record, refer to the NIST AES competition archives documenting the full selection process.

FAQ

Frequently asked questions

Does encryption support UTF-8 output?

No. Encryption in this tool does not support UTF-8 output. Use HEX or Base64 for encrypted output.

Does decryption support UTF-8 input?

No. Decryption expects encrypted input in HEX or Base64 format.

What happens if I choose HEX output?

You can use the upper-case and lower-case buttons to normalize the HEX output after encryption or decryption.

Is this page suitable for sensitive production data?

This page is intended for educational and testing purposes. Sensitive production workloads should use audited libraries, strong key management, and secure operational controls.