EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Size of Armored Encrypted Text

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#514
Posted: 06/21/2006 17:48:23
by Charles Poston (Standard support level)
Joined: 06/12/2006
Posts: 15

Is there a way to know what size PGP armored encrypted text will be? Does the key size affect this? Will compression? I want to limit my result to a size. How can I do this?
#516
Posted: 06/22/2006 02:50:13
by Ken Ivanov (EldoS Corp.)

The approximate size of the armoured file can be calculated using the following formula:

enc_size = (source_size + 128 + 2 * (key_bits / 8)) * 1.375 + 2048,

where
source_size is the size of the input data,
key_bits is the number of bits in a public key.

Please note, that the actual size of the encrypted message can be smaller than the estimated value, but should not be greater.
#519
Posted: 06/22/2006 09:27:20
by Charles Poston (Standard support level)
Joined: 06/12/2006
Posts: 15

OK, 16 byte test string, 512 public key:

((16 + 128 + (2 * (512 / 8))) * 1.375) + 2048
((16 + 128 + (2 * 64)) * 1.375) + 2048
((16 + 128 + 128) * 1.375) + 2048
(272 * 1.375) + 2048
374 + 2048
2422

But when I actually encrypt the string I get: 396?!
Did I misinterpret your formula? Obviously what I am asking for is how can I be sure that the database field I have defined for my encrypted text will always fit.
#520
Posted: 06/22/2006 09:48:17
by Ken Ivanov (EldoS Corp.)

The actual size of the output encrypted message depends on a lot of different settings (key properties, message properties, filename length etc.), so the estimated size value is not accurate. However, as I said:
Quote
Please note, that the actual size of the encrypted message can be smaller than the estimated value, but should not be greater.

The difference between estimated and actual sizes is big (2026 in your case) with small input messages, and smaller with bigger ones.

Reply

Statistics

Topic viewed 3820 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!