Blog | G5 Cyber Security

One-Time Pad Systems: Still Used?

TL;DR

Yes, one-time pads are still used, but rarely in the way most people think. True one-time pad systems are incredibly secure but difficult to implement practically. They’re mainly found in high-security government and military applications where cost isn’t a major concern. More commonly, systems claiming to be ‘one-time pads’ use pseudo-random number generators which significantly weaken security.

What is a One-Time Pad?

A one-time pad (OTP) is theoretically unbreakable if used correctly. It involves these key principles:

Encryption is usually done with a simple XOR operation.

Are True OTPs Common?

No, not really. Here’s why:

Systems That *Do* Use One-Time Pads

  1. High-Security Communications: Some governments and military organisations use OTPs for very sensitive communications. Details are rarely public.
  2. Diplomatic Cables: Historically, some diplomatic services have used OTPs (though modern cryptography is more common now).

Systems That *Claim* to Use One-Time Pads (But Don’t)

Many systems marketed as ‘one-time pads’ are actually using pseudo-random number generators (PRNGs). These aren’t truly random and can be cracked. Here’s how they differ:

A simple example of XOR encryption (but not a secure OTP because it uses a fixed key):

python
def xor_encrypt(message, key):
  encrypted = ''.join([chr(ord(c1) ^ ord(c2)) for c1, c2 in zip(message, key * (len(message) // len(key) + 1)[:len(message)])])
  return encrypted

message = "This is a secret message"
key = "secretkey"
encrypted_message = xor_encrypt(message, key)
print(f"Encrypted: {encrypted_message}"

Notice the key is repeated. This makes it breakable.

How to Identify a Real vs. Fake OTP

  1. Randomness Testing: A true pad should pass statistical randomness tests (e.g., NIST SP 800-22).
  2. Key Length: The key must be at least as long as the message.
  3. Single Use Verification: Confirm that the system prevents re-use of keys.
  4. Documentation & Audits: Look for independent security audits and clear documentation about the randomness source.

Alternatives to One-Time Pads

For most applications, modern cryptography offers better practicality and security:

These algorithms are well-studied and have robust implementations available.

Exit mobile version