A method, apparatus, and program for image processing are provided to
perform operations for generating an encoded image, detecting image
alteration on the encoded image, and regenerating an original image from
the encoded image. The encoded image is generated by an encoding
apparatus, which inserts a redundant code into an LSB (least significant
bit) bit-plane of the original image. The redundant code can be generated
based on bit-planes other than the LSB bit-plane, using a CRC (cyclic
redundancy check) method. A decoding apparatus recalculates a redundant
code from the encoded image, and checks validity of the encoded image
based on the extracted redundant code.