Password7Decrypt

Encoding vs. Encryption vs. Hashing: What Network Engineers Actually Need to Know

These three words show up interchangeably in vendor docs, job interviews and Slack threads, and mixing them up leads to real security mistakes. Here is the practical difference.

By Khan Mehfooz Published 18 Jul 2026 9 min read Level: Beginner Applies to: Concepts · Cisco Type 5/6/7/8/9

The One-Sentence Version of Each

Cisco Type 7 gets called "encryption" in a lot of documentation and forum posts, but functionally it's closer to encoding: there's no secret key involved, just a fixed, publicly documented XOR table. Anyone with the algorithm — which has been public for decades — can reverse it instantly. That's why tools like our own Type 7 decoder exist and work reliably on every valid hash.

Encoding: Base64, URL Encoding, Type 7

Encoding exists to make data safe to transmit or store in a particular format — not to hide it. Base64 turns binary data into ASCII text so it survives email transport. URL encoding escapes special characters so a query string doesn't break. Cisco Type 7 XORs each byte against a fixed 53-entry lookup table so a password doesn't sit in the config file as raw plaintext at a glance.

The common thread: none of these require a secret to reverse. The "key" — if you can call it that — is the algorithm itself, and the algorithm is public. Security through this kind of obfuscation only works against a human skimming a file with their eyes, not against anyone who bothers to look up how the encoding works.

Encryption: AES, and Cisco Type 6

Real encryption requires a key that isn't embedded in the same document as the ciphertext (ideally). AES-256, for example, is computationally infeasible to reverse without the key, even with significant compute resources. Cisco's Type 6 password encryption is a genuine (if dated) example on IOS devices: passwords are AES-encrypted using a master key stored separately via the key config-key password-encrypt command — meaning a leaked config file alone isn't enough to recover the passwords, unlike Type 7.

The security of any encryption scheme lives entirely in how well the key is protected. An encrypted config file with the key sitting in the same backup archive offers little more protection than Type 7 does.

Hashing: SHA-256, scrypt, and Cisco Type 8/9

Hashing is the only one-way transformation of the three. Feed it any input and you get a fixed-length output; feed it the same input again and you get the same output, but there's no mathematical way to go backward from the hash to the original input. This is exactly what you want for password storage: the system only ever needs to verify a login attempt, never recover the original password.

Cisco Type 8 (PBKDF2-SHA256) and Type 9 (scrypt) are both salted, iterated hashes designed specifically to resist brute-force and rainbow-table attacks — scrypt additionally makes large-scale GPU cracking expensive by being memory-hard. Neither can be "decoded" the way Type 7 can. If you've forgotten a Type 8/9 password, the only real recovery path is resetting it, not reversing it — that's the entire point.

Quick Reference

Category Reversible? Needs a secret key? Example
Encoding Yes, always No Base64, Cisco Type 7
Encryption Yes, with the key Yes AES-256, Cisco Type 6
Hashing No, never No (uses a salt instead) SHA-256, scrypt, Cisco Type 8/9

How to Recognise Each One in a Cisco Config

You can usually tell what protects a password by looking at how it is stored. A Type 7 string begins with two digits, which are the starting position in the lookup table, followed by hexadecimal characters, for example password 7 0822455D0A16. Type 5 hashes start with $1$, Type 8 with $8$ and Type 9 with $9$. A line that shows password 0, or a bare password with readable text, is plaintext.

This is why the digit after the keyword matters so much. It names the scheme, and the scheme decides whether someone who reads the file can recover the password. Two of the schemes can be reversed by anyone: plaintext and Type 7. The others cannot be reversed, only guessed at.

show running-config | include secret|password

Run this on a device to see every line that carries a credential, and read the type number on each one.

Common Mistakes That Come From Mixing Them Up

Which One Should You Use?

Ask what the system must do with the value later.

A salt is a random value added before hashing, so two users with the same password get different hashes and precomputed tables stop working. Type 7 has no salt, which is one more reason it fails. For a full migration plan, see migrating from Type 7 to Type 9, and for a review of your current devices use the password security checklist.

Summary

Encoding changes the format and can be undone by anyone. Encryption hides data from anyone without the key. Hashing produces a one-way fingerprint, which is what you want for stored passwords. Cisco Type 7 is encoding, not encryption, so treat any Type 7 password as readable and move to Type 8 or 9 for logins.

Related reading: Ready to move off Type 7? See Migrating from Type 7 to Type 9 for a step-by-step process.
Before you apply this in production: command syntax and defaults vary between IOS and IOS-XE releases and between hardware models. Check the configuration guide and release notes for your exact platform and software version, and test changes in a lab or maintenance window first. Example IP addresses and passwords here are placeholders.
About the author. Khan Mehfooz is a Network Security Engineer who writes practical Cisco guides and tools for network and security engineers. More of his work is at SwitchFirewall.com.