0
$\begingroup$

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?

$\endgroup$

2 Answers 2

3
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Thanks for your answer. $\endgroup$
    – Xenomorph
    Commented Nov 29, 2022 at 5:28
8
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Thank you very much for your explanation. $\endgroup$
    – Xenomorph
    Commented Nov 29, 2022 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.