The invention discloses a
watermark embedding and
authentication method for PNG (Portable Network Graphic) electronic
invoice image content protection. The method has the main steps that: a PNG electronic
invoice image is blocked, and in addition, image blocks are divided into a key class, a uniform class and a nonuniform class according to the contents of the image blocks and whether changeable pixel points are contained or not; the contents of image blocks of RGB (Red Green Blue) three components are respectively encrypted, then,
watermark information is generated, and corresponding
watermark embedding positions are selected according to different component image block classes; and the authenticity of the image blocks is judged through comparing the consistency of image block reconstructing watermarks and extracted watermarks, in addition, a transverse neighborhood extending detection method is adopted for further improving the tamper
detection performance, and finally, an
authentication result of an electronic
invoice to be detected is obtained through integrating the detection conditions of the RGB three components. The
watermark embedding and
authentication method has the advantages that the watermark
invisibility is enabled to be realized, and meanwhile, the increase in the PNG image size is little; the tamper detection accuracy is high; the
false detection rate is low; and the tamper such as replacing, adding, deleting and collaging can be effectively resisted.