Provided is a method, system, and program for encoding and decoding input
data. A key is generated comprising a list of a plurality of binary values, wherein
the key is available to a user during decoding. The input data is encoded by using
the key to initialize a replacement list. A determination is made whether to replace
strings in the input data with a string reference to a matching string value, wherein
the input data not replaced with reference to one matching string value comprises
one or more literals. Each literal is replaced with a literal reference to one
entry in the replacement list matching the literal. The encoded input data is decoded
by accessing the generated key in response to user input and using the accessed
key to decode the literals replaced with literal references to entries in the replacement list.