thoughtasylumTOOLBOX Preview

Tools › Ciphers

Image Encryption

Encrypt a picture's pixels with a password into a viewable image of noise and back, or see why ECB mode leaks the outline.

About this tool What it's for, how to use it and an example

What it's for

Encrypt the pixels of a picture with a password, so the result is still a picture but shows only noise, and decrypt it again. It also shows, side by side with proper encryption, why encrypting in ECB mode is a mistake.

  • When you want to share a picture that only someone with the password can see, as an image rather than a file.
  • When you’re learning or teaching cryptography: the ECB picture shows its outline through the encryption.

How to use it

Choose an image (or drop or paste one) and type a password, pick a method (remembered), and choose Encrypt. You get a PNG to download. To decrypt, choose that PNG, type the password and choose Decrypt: the method is read from the image.

  • AES encrypts the red, green and blue of every pixel with AES-256 in counter mode. The result is noise.
  • Shuffle pixels moves the pixels to positions set by the password. It hides the picture, but every colour is still there, so it’s not secure.
  • AES in ECB mode encrypts each 16 bytes on its own. Identical blocks give identical results, so flat areas stay flat and the outline shows. It’s a demonstration and can’t be decrypted here.

Example

Choose a picture with large flat areas, such as a logo or a screenshot of text, type this as the password:

pw

and choose AES in ECB mode and Encrypt: the shapes are still recognisable through the noise. Choose AES and Encrypt with the same picture and nothing of it can be seen.

Good to know

The encrypted image must stay this PNG: converting or re-saving it destroys both the pixels and the details stored in the file that decryption needs. Transparency isn’t encrypted, so the outline of a transparent image shows. The key comes from the password through PBKDF2 with 600,000 iterations, and the encryption isn’t authenticated, so a wrong password gives noise rather than an error. Use Encrypt / Decrypt for a file that must stay private; this is for pictures that should still look like pictures.

Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.

Saved you a few minutes? Say thanks with a coffee.

Something wrong with this tool, or missing from it? Report a bug or suggest a feature.

↑ ↓ move↵ openesc close