Cryptography · Topic 3 of 3

Cryptography Tools, Cryptanalysis and Countermeasures

Learn common cryptography tools, cryptanalysis methods such as known plaintext, brute force and side channel, famous crypto flaws, and the countermeasures.

  • 5 min
In a nutshell
  • Brute force is defeated by long keys, rainbow tables by salting.
  • Known plaintext, chosen plaintext and ciphertext only describe what the attacker holds.
  • Linear and differential cryptanalysis are mathematical attacks on block ciphers.

What it is

Cryptography tools apply hashing and encryption: calculators, file and message encryptors, and general toolkits. Cryptanalysis is the study of breaking cryptography without knowing the key, or finding weaknesses in how it is used. Countermeasures are the choices that keep a system safe from such attacks.

The exam asks you to match a tool to its use, name an attack from its description, and select the control that stops it.

Captureciphertext or hashAnalyzefind pattern or weaknessRecoverkey or plaintextDefendstronger design

How it works

Cryptography tools

ToolPurpose
OpenSSLToolkit for TLS, certificates, hashing and encryption
GnuPGEncrypts and signs files and email with OpenPGP
VeraCryptEncrypted volumes and disks
HashCalc and MD5 CalculatorCalculate hashes to check file integrity
CryptoForge and Advanced Encryption PackageFile and folder encryption
BCTextEncoderEncrypts text snippets
CrypToolEducational tool to learn and test classical and modern ciphers
Hashcat and John the RipperRecover passwords from hashes
Ophcrack and RainbowCrackUse precomputed rainbow tables

Cryptanalysis methods

By what the attacker has:

AttackAttacker has
Ciphertext onlyOnly encrypted data
Known plaintextSome matching plaintext and ciphertext pairs
Chosen plaintextCan have chosen plaintext encrypted
Chosen ciphertextCan have chosen ciphertext decrypted
Adaptive chosen plaintextChooses plaintext in rounds, using earlier results

By technique:

TechniqueIdea
Brute forceTry every possible key. Defeated by long keys.
Dictionary attackTry likely passwords from a list
Rainbow tablePrecomputed hash lookups. Defeated by salting.
Birthday attackExploits the chance of two inputs sharing a hash (a collision). Shows why hashes need enough output bits.
Meet in the middleAttacks a double encryption by working from both ends, which is why 2DES gave little gain
Differential cryptanalysisStudies how differences in input affect differences in output
Linear cryptanalysisUses linear approximations of the cipher with known plaintext
Integral cryptanalysisStudies sets of inputs and how the sum of outputs behaves
Side channel attackMeasures timing, power use, sound or electromagnetic output to learn the key
Fault injectionInduces errors in hardware to leak secrets
Related key attackUses ciphers run with keys that have a known relationship
Rubber hose and social engineeringObtains the key from people instead of from the math

Known flaws in practice

NameWeakness
HeartbleedA bug in an OpenSSL extension let attackers read server memory, which could expose keys and data
POODLEA padding weakness in SSL 3.0 that allowed decryption of data after a forced downgrade
DROWNUsed servers that still supported SSLv2 to attack TLS sessions
FREAK and LogjamForced use of weak export grade cryptography
BEASTAttack on TLS 1.0 CBC mode
Padding oracleError messages about padding reveal plaintext, in CBC mode designs
Hash collision (MD5, SHA-1)Two different inputs give the same hash, which breaks signatures and integrity checks

Countermeasures

  • Use current, public algorithms: AES with 128 or 256 bit keys, SHA-2 or SHA-3, RSA with at least 2048 bits, or ECC.
  • Retire DES, 3DES, RC4, MD5 and SHA-1 for security uses.
  • Disable SSL 2.0, SSL 3.0, TLS 1.0 and TLS 1.1, and use TLS 1.2 or 1.3 only.
  • Prefer cipher suites with forward secrecy (ephemeral key exchange), so that one stolen key cannot decrypt past traffic.
  • Salt and hash passwords with a slow, purpose built function such as bcrypt, scrypt or PBKDF2 instead of a fast hash.
  • Protect keys with a hardware security module (HSM) or key management service, rotate them and never hard code them.
  • Use a trusted random number generator.
  • Write code that runs in constant time, and shield hardware against side channels.
  • Patch crypto libraries promptly, and test them with configuration scanners.
  • Use HTTP Strict Transport Security (HSTS) and valid certificates.

A worked example

A site stores user passwords as unsalted MD5 hashes. After a breach, the attacker looks up the hashes in a rainbow table and recovers many passwords within minutes.

The fix has three parts: replace MD5 with a slow hash such as bcrypt, add a unique salt to each password, and require users to reset. Longer passphrases and multi-factor authentication limit further damage.

How the exam asks about this

  • "Which attack uses precomputed hash tables, and what defeats it?" → Rainbow table attack, defeated by salting.
  • "Which attack measures power use or timing to find a key?" → A side channel attack.
  • "In which attack does the attacker have both the plaintext and the ciphertext?" → Known plaintext.

What to remember for the exam

  • Brute force is defeated by long keys, rainbow tables by salting.
  • Known plaintext, chosen plaintext and ciphertext only describe what the attacker holds.
  • Linear and differential cryptanalysis are mathematical attacks on block ciphers.
  • Heartbleed leaked server memory, and POODLE hit SSL 3.0.
  • Forward secrecy, strong keys, modern TLS and key protection are the core fixes.
Watch out

A strong algorithm does not save a weak implementation. Many named attacks are about poor configuration, bad padding handling or leaking side channels.

Common mistakes

Mixing a dictionary attack with a rainbow table. A dictionary attack hashes guesses live, and a rainbow table looks up precomputed results.

Assuming longer keys fix every flaw. They defeat brute force but not implementation bugs.

Using a fast hash for passwords. Speed helps the attacker, so use a deliberately slow function.

Check yourself

  • What makes a rainbow table attack fail?

    Unique salts per password, because precomputed tables no longer match.

  • What is forward secrecy?

    A property where session keys are not derived from a long term key, so stealing it later cannot decrypt past sessions.

  • What was Heartbleed?

    An OpenSSL bug that let attackers read memory from a server, potentially exposing keys and data.

Topic 3 of 3 in Cryptography

Test yourself on Cryptography

The full EC-Council 312-50 question bank has 1,000 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by EC-Council. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.