| With the progress of the times,the proportion of human access to information through the Internet is increasing.Each node in the network is a peer.When it acquires information,it is also acquired by others.Just like a sentence,"you stand on the bridge and watch the scenery,and the people watching the scenery look at you upstairs".In the ocean of information network,how to protect ourselves has become an important topic in the current security field.There are two ways to prevent security a nd secrecy,civil air defense and technical defense.One is to improve their own safety awareness,restrain their own behavior,to achieve the purpose of not leaking information;Another is to solve the problem of information leakage from the equipment and technology level,and form a universal bottom design to achieve the purpose of protecting information.Based on the research of JPEG image compression coding and the technology of image detection,this program designs an algorithm to encrypt and decrypt part of the JPEG image,and uses technology to protect personal privacy from the source.The Secret Camera can be divided into two processes: encryption and decryption.In the image encryption process,the face detection method is used to obtain the locatio n and size of the face region.The chaotic encryption function is used to generate a random sequence to scramble the DCT block in the region,and then the DC coefficient and the AC coefficient are separately encrypted.By studying the influence of image quality factor on the range of values after DC coefficient quantization,a compatible DC coefficient encryption algorithm is designed.By studying the distribution probability and binary coding law of AC coefficient,an algorithm for segmenting the AC coefficient by effective bit number is designed.In the process of image decryption,the image area is extracted by analyzing the coordinate parameters of the encrypted area reserved in the APP n code segment in the file header;or directly through image processing methods such as size transformation and edge detection,the contour of the encrypted area in the image is extracted,and the contour position is adjusted according to the set conditions to correct the errors in the detection process.Finally,the encrypted area is corrected decrypt and recover the original image.The generation of the image encryption key is also combined with the feature that the AC coefficient statistic invariance of non-zero exchange before and after encryption,and the encryption key is adaptively generated,which can effectively resist the known plaintext attack.The program uses opencv,libjpeg and other image processing libraries,combined with Java cross platform call C/C++ methods,and is designed and coded on Android platform.The Secret Camera reads and modifies the contents of the JPEG file according to the design algorithm to achieve the encryption effect.The experimental results show that the Secret Camera can achieve the purpose of encrypting the privacy protection area in the image,which can effectively solve the compatibility problem of the encrypted image format,and perform well in image size and security. |