Encryption and Dictionary Size?

I recently downloaded 7-Zip. While checking out its optiona, among them was encryption under the 7z format, using the LZMA method . However, I don’t understand when it refers to “dictionary,” such as “Small memory requirement for decompression (depends from dictionary size)” Can someone explan this?

That’s a rather illegible error message, but a dictionary in reference to file compression (not encryption–so far as I know) is talking about a lookup table used to refill in data.

Say that I notice that “th” is really a letter in its own right, so I decide to compress it down into a single character. Since I’m not going to actually display it, I create a table of compressed characters, and put the index into that table back in the original text.

So say I have the text, “Hello there. Do you know what this is?”

I create a table with one entry:

table[0] = “th”
data = “Hello 0ere. Do you know what 0is is?”

I add another for “is”

table[0] = “th”
table[1] = “is”
data = “Hello 0ere. Do you know what 01 1?”

I add another for "o "

table[0] = “th”
table[1] = “is”
table[2] = "o "
data = “Hell20ere. D2you know what 01 1?”

So, there’s my dictionary and my compressed data.

Meanwhile, you might free up room in your character space by encoding rare letters, such as q or z, with multiple characters. You can generally get higher compression ratios with a more extensive dictionary, but it depends on what you know about your input. “th” is very common in English, for instance, so that’s something that I might want to include in a general-purpose English dictionary. In fact, for compressing English-language text, the program probably already has a built-in dictionary that it always uses, so the compressed file can just include a note at the beginning, “Decompress this using the standard English dictionary”.

On the other hand, if the input is something other than English text, then the standard English dictionary won’t be of much use, and you may have to construct a custom dictionary for use with that message, and include the dictionary with the compressed file (so the decompressor knows what to do with it). And if the input is random or something resembling it, then the amount of extra space you need to store the dictionary will be just about the same as the amount of space you save by using it.