Blog | G5 Cyber Security

Slow Ciphers: Examples & Use Cases

TL;DR

Yes, ciphers can be deliberately designed to be slow. This isn’t usually about breaking security, but rather creating a system where the computational cost is part of the design – often for things like password hashing or key derivation. We’ll look at examples and why you might use them.

1. Why Slow Down Encryption?

Standard encryption aims for speed. But sometimes, you *want* it to be slow. Here’s why:

2. Examples of Slow Ciphers & Functions

These aren’t traditional encryption algorithms like AES or RSA, but functions built to be computationally expensive.

a) bcrypt

bcrypt is a password hashing function specifically designed to be slow and adaptable. It uses a ‘work factor’ which controls the computational cost. Higher work factors mean more time to hash (and crack).

b) scrypt

scrypt is another password hashing function that’s even more memory-intensive than bcrypt, making it harder to accelerate with custom hardware (like ASICs). It also uses a work factor.

c) Argon2

Argon2 is a modern KDF that’s considered the state-of-the-art for password hashing. It offers different variants (Argon2d, Argon2i, Argon2id) optimised for different attack scenarios.

d) PBKDF2

Password-Based Key Derivation Function 2 is a widely used KDF that uses a pseudorandom function (like HMAC-SHA256) to derive keys from passwords. It also relies on iterations.

3. Implementing Slow Ciphers – Important Considerations

  1. Work Factor/Iterations: Carefully choose the work factor or number of iterations. Too low, and it’s easily cracked; too high, and you impact user experience (login times).
  2. Salting: Always use a unique, randomly generated salt for each password. This prevents rainbow table attacks.
  3. Library Choice: Use well-vetted cryptography libraries like bcrypt, scrypt, Argon2 or passlib in Python. Avoid implementing these functions yourself unless you are an expert.
  4. Regular Updates: Keep your cryptography libraries up to date to benefit from security improvements and bug fixes.

4. When *Not* To Use Slow Ciphers

Don’t use slow ciphers for general encryption of data at rest or in transit. They are specifically designed for password hashing and key derivation, not bulk data protection.

Exit mobile version