Decode the Stored Credential: Base64 Is Not Encryption

Privilege Escalation & Post-Exploitation Level 2/4 ~3 min August 25, 2026

The challenge

An application claims it 'encrypts' its database password before saving it, but the stored value is only base64. Recover the password from the encoded blob and submit the database password.

What you'll learn

  • Recognise base64 in a stored credential by its character set and == padding
  • Decode a base64 blob in one click to recover a plaintext password
  • Understand why base64 is not encryption and offers no protection at rest
  • See that anyone who can read a stored value can decode base64 with no key
  • Know what real protection of a stored credential requires

Skills tested

Base64 recognitionBase64 decodingAssessing credential storage weaknesses

Prerequisites

  • The idea that applications store database passwords somewhere
  • Comfort recognising base64 by its trailing == padding

How it works

Applications need a password to connect to their database, and that password has to live somewhere the app can read it at startup - a config file, an environment variable, or a settings table. A common but mistaken pattern is to base64 the password before storing it and describe that as "encryption" so it looks safer in a review. It is not encryption. base64 is a reversible, public encoding with no key, so the obscured value is one decode away from the real password.

You can recognise base64 in a stored blob the same way you do anywhere else. It uses upper and lower case letters and digits, can carry a couple of symbols, and frequently ends with one or two = signs of padding. The stored value here ends with ==, which is a strong signal that the outer form is base64. Decoding it reveals the original password in plain text, exactly as the app uses it.

The security impact is direct. Anyone who can read the stored value - through a leaked config, a backup, a log line, or a compromised host - can recover the live database password in a single click, because no secret is needed to reverse base64. That is why base64 storage is a privilege-escalation gift: it turns read access to a file into full database credentials. The ROT13, hex, URL, and reverse buttons expect different input shapes and are decoys here.

Common mistakes

  • Believing "encrypted" means safe. Calling base64 encryption does not give it a key. The value is reversible by anyone who can read it.
  • Choosing the wrong decoder. hex uses only 0-9a-f and ROT13 keeps the same length and shape. The mixed case, symbols, and == padding point to base64.
  • Submitting the encoded blob. The answer is the decoded password, not the base64 string.
  • Assuming storage at rest is low risk. A readable config or backup turns a base64 password straight into live database access.

How to defend against it

The fix is to stop treating base64 as protection and to handle stored credentials properly. A database password the app must use at runtime should come from a managed secret store, not a base64 blob in a file, and the value should never be described as encrypted unless it truly is.

  • Store service credentials in a dedicated secrets manager with access control and audit logging, not in plain config.
  • If a credential must sit in config, encrypt it with authenticated encryption using a key the application fetches from a managed store, never base64.
  • Restrict read access to config files, backups, and logs so the stored value is not casually exposed.
  • Rotate any credential that has ever been stored as base64, since it should be treated as already disclosed.

Full solution

Pro and Max members unlock the complete step-by-step walkthrough.

Go Pro

Community stats

177 completions
89% success rate
Hope First blood

Related Daily Hacks

22,000+ Hackers 100+ Labs & Courses Free
Start Hacking Free