What is AES encryption and how secure is it

5 min read January 25, 2024

AES (Advanced Encryption Standard) is the most widely used symmetric encryption algorithm in the world. It’s used to protect data on your laptop, in HTTPS connections, in banking systems, and in credential storage — including how ByeSQL stores your database passwords.

This guide explains what AES-256 is, what “encrypted at rest” actually means in practice, and what it does and doesn’t protect against.

What AES is

AES is a symmetric encryption algorithm, which means the same key is used to encrypt and decrypt data. It operates on fixed-size blocks of data (128 bits) and applies a series of mathematical transformations based on the key.

The “256” in AES-256 refers to the key length: 256 bits. AES also comes in 128-bit and 192-bit variants, but 256-bit is the standard choice for sensitive data because it provides the largest security margin.

Why AES-256 specifically

A 256-bit key means there are 2^256 possible key values — a number so large it is effectively impossible to guess by brute force with any technology that exists or is foreseeable. For comparison:

  • There are approximately 10^80 atoms in the observable universe
  • 2^256 ≈ 10^77

Even with dedicated hardware running billions of guesses per second, exhausting all possible AES-256 keys would take longer than the age of the universe many times over.

AES-256 has been analysed extensively since the early 2000s. No practical attack exists against a properly implemented AES-256 cipher. It is approved by the US National Security Agency for protecting top secret information.

What “encrypted at rest” means

“Encrypted at rest” means the data is encrypted when stored on disk — in a database, a file, or a backup.

When ByeSQL stores your database password, it doesn’t store the password text. It stores an encrypted version of it. The encryption happens before the value is written to the database. When ByeSQL needs to use the password (to establish a connection), it decrypts the value in memory, uses it, and the plaintext never persists.

What this protects against

Database breach: If someone gains access to ByeSQL’s database — for example through a SQL injection attack, a misconfigured backup, or a compromised database server — they see ciphertext, not passwords. Without the encryption key, the ciphertext is useless.

Data dumps and backups: Encrypted values remain encrypted in backups and data exports. Stolen backups don’t yield plaintext credentials.

What this does not protect against

Compromised application layer: If an attacker gains access to the running application process — not just the database — they can potentially access decrypted values in memory, or intercept them in transit between the application and the database. Encryption at rest protects stored data, not data in active use.

Weak key storage: Encryption is only as strong as key management. If the encryption key is stored in the same place as the encrypted data, encrypting the data provides limited additional protection.

Key separation: why it matters

The critical detail in any “encrypted at rest” implementation is where the key lives.

If you encrypt data with a key stored in the same database, an attacker who accesses the database gets both the ciphertext and the key — and can decrypt everything. This is called “encrypting the data next to the key” and it undermines the entire point.

Proper key management means:

  • The encryption key is stored in a separate system from the encrypted data (a secrets manager, HSM, or isolated key store)
  • The key is accessed only by the application process at runtime, never stored alongside the encrypted values
  • Access to the key store is separately controlled and audited

ByeSQL stores database credentials encrypted with AES-256, with the encryption key held in a separate secrets store. An attacker who accesses the ByeSQL application database gets ciphertext values. Without access to the key store — a separate system with different access controls — those values cannot be decrypted.

This means that even in a realistic worst-case scenario of a database breach, your database passwords remain protected.

How to verify claims like these

When evaluating any tool that stores your credentials, ask:

  1. How are credentials stored? “Encrypted” is not enough — ask for the algorithm and key size.
  2. Where is the key stored? The answer should be “separately from the application database.”
  3. Who has access to the key store? Should be restricted to the application runtime, with logging.
  4. Are credentials ever logged? They should not be. Logging systems are often less protected than databases.

Most tools don’t publish this level of detail proactively. Asking the question is itself useful signal.

Practical summary

ScenarioAES-256 + key separationNo encryption
Database file stolenCredentials unreadableCredentials exposed
Database backup stolenCredentials unreadableCredentials exposed
Application process compromisedCredentials potentially exposedCredentials exposed
Key store also compromisedCredentials exposedCredentials exposed

AES-256 with proper key separation is not a perfect defence — nothing is. But it significantly raises the cost of an attack and limits the damage from the most common type of breach (database access without application-level access).

It is the right baseline for credential storage.