2

On wikipedia there is an example of a picture encrypted with ECB:

http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29

I just wanted to know how an encrypted file could be displayed as a picture ?

David 天宇 Wong
  • 1,535
  • 11
  • 26

1 Answers1

2

This is off-topic, but arbitrary binary data can be read as image data using for example the Netpbm family of file formats. For example, here's how to read 10000 bytes of random data as a 100x100 grayscale image:

$ cat > image.pgm
    P2
    100 100 255
    ^C                             
    $ dd if=/dev/urandom of=image.raw bs=10000 count=1
1+0 records in
1+0 records out
10000 bytes transferred in 0.001229 secs (8136380 bytes/sec)
$ od -A n -t u1 image.raw >> image.pgm  

You can then open image.pgm for example in Gimp.

fkraiem
  • 8,112
  • 2
  • 27
  • 38