Concepts / Cryptography at work

Cryptography at work

Encoding vs encryption

Also called obfuscation, deobfuscation, layered encoding

Obfuscation hides a payload with reversible transforms — base64, hex, a short XOR — that use no key, so unlike encryption it peels straight back to the original: encoding, not encryption.

Encoding has no key
Encoding has no key

Base64 and hex reverse with one command and no secret, so they only hide data from a glance. Encryption stays shut for anyone without the key.

Encoding changes how data is written, with no key, so anyone can reverse it; encryption stays shut without the key. Base64 and hex are encodings: they hide a payload from a glance or a plain string match. A one-byte XOR has only 256 keys, so you try them all. Obfuscated scripts stack such layers; peel them one at a time, without running the sample, to reach the [[indicators-of-compromise|indicator]] inside.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab