0

I am a Bitcoin enthusiast, but I have never been formally trained in the study of computer science and cryptography.

Recently, I tried a new way to encrypt my private key: I wrote it down on a paper, and used my camera to take a photo of that paper sheet. Then, I encrypted the photo from pgp4win.

Then I noticed that the size of the photo is significantly smaller after encryption.

Can any expert in cryptography elaborate it to me why the size shrinks so much after encryption by pgp4win? Suppose I repeat encryption followed by decryption for, say, 10,000 times, can I still recover the original photo with all the details of pixels?

Valac
  • 111
  • 4

2 Answers2

8

PGP4Win (by default) does compression before encrypting. Many photos are extremely compressible, and so that compression shrinks the size a lot - rather more than the encryption overhead, resulting in an ciphertext that's smaller than the original plaintext.

However, encrypting the file again won't help - unlike a photo, an encrypted file is not compressible, and so encrypting it again won't shrink it any.

poncho
  • 147,019
  • 11
  • 229
  • 360
3

Encryption/decryption schemes are lossless, meaning you should be able to recover ALL of the original data with the proper decryption keys.

It's possible your pgp4win encryption includes some sort of compression as a part of their encryption process. This could be something as simple as zipping the files, and I think you would see a very similar (if not the exact same) size with multiple encryptions.

Only if they were employing some form of lossy compression would the file size continue getting smaller and smaller, and in that case no, you would not be able to recover the original photo with all the details of the pixels.

KMehta
  • 46
  • 2