A method and apparatus for encrypting and decrypting digital data
employing multiple Huffman tables and at least one encryption key to
enhance security of the digital data. At least one image parameter for
characterizing the digital data, such as a motion vector table or
DC-luminance, is selected as an image parameter. All possible Huffman
tables according to the image parameter are then generated by Huffman
tree mutation. A predetermined number of active Huffman tables from all
possible Huffman tables are selected using a first encryption key and a
hash function. Afterward, a coding sequence for the active Huffman tables
is generated using a second encryption key and the hash function.
Finally, the digital data is encrypted into an encrypted bit stream by
the active Huffman tables with the coding sequence. Encrypted symbols of
the image parameter can be reduced by symbol statistic analysis, thus
reducing computation effort.