Cipher Utility

Choosing the Right Encryption for Your Needs

Match the tool to the job: data at rest, data in transit, passwords.

The short answer

For most applications in 2026, these choices are safe, fast and widely supported:

JobDefault choiceFor extra margin
Encrypting dataAES-128-GCM or AES-256-GCMAES-256-GCM
Encrypting on devices without AES hardwareChaCha20-Poly1305ChaCha20-Poly1305
Key exchangeX25519 or ECDH P-256ECDH P-384, or a hybrid with ML-KEM
SignaturesEd25519 or ECDSA P-256ECDSA P-384
Hashing and integritySHA-256SHA-384, SHA-512 or SHA-3
Storing passwordsArgon2id or bcryptArgon2id with higher memory settings
Data in transitTLS 1.3TLS 1.3 with mutual authentication

The rest of this article explains how to decide, and which mistakes undo even a good choice.

Start with what you are protecting

How sensitive is the data?

  • Low: public content such as a product catalogue. It may still need integrity protection, but not secrecy.
  • Medium: personal details, internal messages and customer records such as email addresses and preferences.
  • High: payment data, medical records, national ID numbers, passwords and credentials.

Who might attack it?

Opportunistic attackers scan for easy targets: leaked databases, unencrypted backups, default passwords. Well-funded attackers, such as organized crime groups or state agencies, pick a target and keep going. Standard algorithms used correctly hold up against both; the difference is how much care you need to put into key management, monitoring and implementation details.

How long must it stay secret?

Session tokens and live messages only need to stay secret for hours or months. Customer records need years. Medical, legal and financial archives can need decades. For data that must stay secret for many years, use 256-bit symmetric keys and plan for post-quantum public key algorithms, because recorded traffic could be decrypted later by a future quantum computer.

Things that decide between options

Performance

AES-128 is fast and secure, and almost every processor has AES instructions. AES-256 adds a little cost and a larger margin, including against quantum attacks. ChaCha20 needs no special hardware and is the faster choice in plain software, which is why TLS uses it on many phones and small devices.

Compatibility

AES, SHA-256 and RSA work everywhere, including old systems. Newer designs such as ChaCha20, X25519 and Ed25519 are supported by all current libraries and platforms, but may be missing on legacy systems you need to talk to.

Hardware support

Most current processors have AES instructions (AES-NI on x86, the cryptography extensions on ARMv8) and many have SHA-256 instructions. ChaCha20 and Poly1305 run in normal software and are designed to be fast and constant time there.

Symmetric encryption

Symmetric encryption, where one key encrypts and decrypts, does the bulk of the work in almost every system. AES encryption explained covers how AES works.

UseRecommendedAlternativeNotes
Web trafficAES-128-GCMChaCha20-Poly1305Negotiated by TLS; you configure the server, not the cipher calls
Files and backupsAES-256-GCMXChaCha20-Poly1305Large files are encrypted in chunks, each with its own nonce
Database fieldsAES-256-GCMAES-128-GCMPlan for key rotation from the start
Mobile appsAES-GCM or ChaCha20-Poly1305Use the platform's crypto APIs
Small embedded devicesAES-128-CCM or AsconChaCha20-Poly1305Memory and power are the limits
Government systemsAES-256-GCMUsually needs FIPS 140 validated modules

Modes of operation

  • GCM encrypts and authenticates in one step, so tampering is detected. It is the usual choice.
  • CTR allows parallel processing and random access, but needs a separate MAC to detect changes.
  • CBC is an older mode that is fine for compatibility when combined with a MAC and a random IV.
  • ECB encrypts identical blocks to identical output, so patterns in the data stay visible. Never use it.

Whatever the mode, never reuse a nonce or IV with the same key. In GCM and CTR, a single reuse can reveal plain text and, for GCM, allow forgeries.

Public key cryptography

Public key methods solve two problems symmetric ciphers can't: agreeing on a key with someone you have never met, and proving who wrote something. Symmetric vs asymmetric encryption explains how the two kinds fit together.

Key exchange

  • X25519 is fast, has 32-byte keys and is designed to be hard to implement wrongly. It is the default in TLS 1.3, SSH and Signal.
  • ECDH with the NIST curves P-256 or P-384 is the choice where FIPS compliance is required.
  • RSA key transport is the old method of encrypting a secret with the server's RSA key. TLS 1.3 removed it because it gives no forward secrecy.

Signatures

  • Ed25519 has small keys and signatures, is fast and produces deterministic signatures, which avoids a whole class of random-number failures.
  • ECDSA with P-256 or P-384 is the standard elliptic curve signature and is required in many compliance settings.
  • RSA-PSS with at least 3072-bit keys is the choice when you need RSA compatibility. Signatures and keys are much larger.

Digital signatures explained walks through signing and verifying.

Equivalent key sizes

NIST groups algorithms by security level, the number of bits of work needed to break them:

Security levelAESRSAElliptic curve
128 bitsAES-1283072 bitsP-256, Curve25519
192 bitsAES-1927680 bitsP-384
256 bitsAES-25615360 bitsP-521

128-bit security is enough for nearly all commercial use. RSA keys grow so quickly at higher levels that elliptic curves are the practical choice there.

Hash functions and password hashing

Integrity and signatures

Use SHA-256 or another SHA-2 function, or SHA-3, which has a different internal design and so offers a backup if SHA-2 were ever weakened. BLAKE3 is a newer cryptographic hash that is much faster in software. Don't use MD5 or SHA-1 for anything security related; both have practical collision attacks. Why MD5 isn't secure explains why.

Passwords

Never store passwords with a plain fast hash. Use a password hashing function, which is slow on purpose and salts each password:

  • Argon2id, the winner of the 2015 Password Hashing Competition, uses lots of memory to slow down attacks with graphics cards and custom chips. It is the first choice for new systems.
  • scrypt is also memory-hard and a good alternative.
  • Bcrypt has been in use since 1999, is supported everywhere and is still acceptable with a cost of 10 or more. Note that it only uses the first 72 bytes of a password.

Hashing passwords correctly has settings and code.

When you don't need security

For hash tables, deduplication and cache keys, non-cryptographic hashes such as xxHash are much faster. Just don't use them anywhere an attacker could choose the input to cause collisions.

Example setups

Online shop

TLS 1.3 for every page, card payments handled by a PCI DSS compliant payment provider so card numbers never reach your server, Argon2id or bcrypt for customer passwords, and AES-256-GCM for sensitive fields in the database. Use established libraries; don't write any of this yourself.

Healthcare application

AES-256-GCM for stored records with regular key rotation, TLS 1.3 with mutual authentication between services, and SHA-256 hash chains or signatures on audit logs so tampering is visible. Records kept for decades are a good reason to start testing post-quantum key exchange.

Messaging app

The Signal protocol, with X25519 key agreement and the Double Ratchet, gives end-to-end encryption and forward secrecy. Pair it with an authenticated cipher such as AES-GCM or ChaCha20-Poly1305, Ed25519 for identity keys and SHA-256 for hashing. Use an existing implementation such as libsignal.

Document storage

Encrypt each file with its own random AES-256-GCM key, processed in chunks so large files can be read without decrypting everything. Then protect those file keys with a master key held in a key management service or hardware security module. Rotating the master key then means re-encrypting small keys, not every file.

Mistakes that break good algorithms

  • Writing your own crypto. Use libsodium, OpenSSL, the WebCrypto API, Python's cryptography package, Go's crypto packages or Bouncy Castle.
  • Reusing a nonce or IV with the same key.
  • Using ECB mode, or encryption without authentication.
  • Using weak random numbers. Use the operating system's secure source (getrandom, /dev/urandom, BCryptGenRandom) or your language's cryptographic random API, never a general-purpose random function.
  • Keeping keys next to the data, in source code or in plain configuration files.
  • Comparing secrets with ordinary string comparison, which can leak timing information. Use a constant-time comparison.
  • Letting crypto libraries go out of date.

Planning for change

Algorithms get retired, so design for it. Store an algorithm or version identifier with every encrypted value and signature, keep the algorithm choice in configuration rather than spread through the code, and make key rotation a routine operation.

Large quantum computers would break today's public key algorithms (RSA and elliptic curves) but only weaken symmetric ciphers and hashes. In 2024 NIST published its first post-quantum standards: ML-KEM for key exchange (based on CRYSTALS-Kyber), and ML-DSA and SLH-DSA for signatures (based on CRYSTALS-Dilithium and SPHINCS+). A signature scheme based on FALCON is also being standardized. Their keys and signatures are larger than today's. The usual approach for now is to combine a classical and a post-quantum algorithm in a hybrid, as browsers already do in TLS, and to use AES-256 for data that has to stay secret for a long time.

Try it on Cipher Utility

Further reading