CN111683190B - Method for realizing image anti-theft and local encrypted image restoration in JavaScript - Google Patents

Method for realizing image anti-theft and local encrypted image restoration in JavaScript Download PDF

Info

Publication number
CN111683190B
CN111683190B CN202010510294.8A CN202010510294A CN111683190B CN 111683190 B CN111683190 B CN 111683190B CN 202010510294 A CN202010510294 A CN 202010510294A CN 111683190 B CN111683190 B CN 111683190B
Authority
CN
China
Prior art keywords
image
encrypted
local
restored
javascript
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010510294.8A
Other languages
Chinese (zh)
Other versions
CN111683190A (en
Inventor
肖刚
施朝伟
陈立
张骞
王介博
康强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huzhou Yunti Technology Co ltd
Original Assignee
Hangzhou Yunti Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Yunti Technology Co ltd filed Critical Hangzhou Yunti Technology Co ltd
Priority to CN202010510294.8A priority Critical patent/CN111683190B/en
Publication of CN111683190A publication Critical patent/CN111683190A/en
Application granted granted Critical
Publication of CN111683190B publication Critical patent/CN111683190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/44Secrecy systems
    • H04N1/4446Hiding of documents or document information
    • H04N1/4473Destruction, e.g. shredding of documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/44Secrecy systems
    • H04N1/4446Hiding of documents or document information
    • H04N1/4453Covering, i.e. concealing from above, or folding

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Facsimile Transmission Control (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention discloses a method for realizing image theft prevention and local encrypted image restoration in JavaScript. The image anti-theft method comprises an image encryption step and an image restoration step, wherein the image encryption step comprises the following steps: performing an encryption operation on a local area with a predetermined size and a predetermined position of the original image, wherein the encryption operation is as follows: and performing reducible destruction on the local area to obtain an encrypted image. And an image restoration step: at the preset position in the encrypted image, scratching a partial image which is in linear relation with the preset size and is larger than the preset size; intercepting the encrypted part from the extracted image to perform restoration operation, and covering the restored image to the corresponding position in the extracted image to obtain a restored partial image; and restoring the position of the image which is restored to the partial image to be scratched in the encrypted image into the encrypted image. The invention can realize image theft prevention and restoration in JavaScript, and reduces the calculation cost of image theft prevention in JavaScript.

Description

Method for realizing image anti-theft and local encrypted image restoration in JavaScript
Technical Field
The invention relates to an image encryption technology, in particular to a method for realizing image encryption and image restoration in JavaScript.
Background
The image anti-theft technology based on deep learning needs to send the whole original image to a network for convolution operation, the cost for realizing reasoning and restoring the image at the pc end is low, the realization is easy, the realization is limited by computing resources in JavaScript, and the conversion and restoration of the image cannot be smoothly realized by using the technology as usual.
At present, most of anti-theft technologies are realized by adding watermarks to images and attaching labels to the images, wherein one is to influence the display of image contents, and the other is to remove the watermarks to a certain extent. And secondly, the externally exposed picture URL is limited, and an anonymous visitor can only obtain the picture after the thumbnail processing or the watermarking is added and cannot download the original picture.
In any of these methods, image theft prevention is considered from a system level, and a theft prevention technique for an image is not considered from JavaScript.
Disclosure of Invention
The invention aims to: aiming at the existing problems, the method for realizing the image anti-theft in the JavaScript is provided, so that the problem that the JavaScript computing resources are limited is considered, and the image is encrypted and restored in the JavaScript.
The technical scheme adopted by the invention is as follows:
a method for realizing image theft prevention in JavaScript comprises an image encryption step and an image restoration step:
an image encryption step:
performing an encryption operation on a local area with a predetermined size and a predetermined position of the original image, wherein the encryption operation is as follows: the local area is subjected to reducible damage to obtain an encrypted image; in the encrypted image, the image at the local area position is different from the original image. The so-called reducible damage does not limit the manner of damage and the ultimate effect, as long as the original characteristics of the portion are not directly revealed and the characteristics of the portion can be reduced. The local encryption of the original image can hide specific features of the image (i.e., the original image cannot be obtained by a user), and also considers considering the limited computation resources of JavaScript.
And an image restoration step:
and at the preset position in the encrypted image, scratching a partial image which is in a linear relation with the preset size and is larger than the preset size. The reason why a part of the normal image needs to be added is that the web page is zoomed when the image is displayed, and if only the encrypted part is scratched, the blue color of the encrypted area is interpolated into the normal image, so that a blue color margin appears.
Intercepting an encrypted part from the intercepted image, or intercepting an encrypted part from the encrypted image; and performing a recovery operation on the intercepted encrypted part, wherein the recovery operation comprises the following steps: restoring by using a mode of inverse operation with the encryption operation; and covering the restored image to the corresponding position in the extracted image to obtain a restored local image. The restoration operation corresponds to the encryption operation, and the specific method of the restoration operation is not particularly limited in the present invention, as long as it can normally restore the image after the encryption operation.
And restoring the position of the image which is restored to the partial image to be scratched in the encrypted image into the encrypted image. Namely, the restored image is put back to the corresponding position in the encrypted image, and the result consistent with the original image is obtained.
Further, the step of covering the restored image to the corresponding position in the extracted image specifically includes: and restoring the partial image to zoom in the encrypted image at the zoom ratio of the display interface, and restoring the partial image to the zoomed encrypted image corresponding to the position of the scratched image in the encrypted image.
Considering the situation that the display size of the encrypted image in the webpage is inconsistent with the original size due to inconsistent display screen sizes corresponding to different clients, pc, android and the like, the position of the local image needing to be restored may be changed due to the scaling of the encrypted image. For such cases, it is also desirable to adaptively scale the restored equipped image to be consistent with the scaled encrypted image.
Further, the encryption operation is: training the local area by using a first convolutional neural network; the reduction operation comprises the following steps: training the encrypted portion using a second convolutional neural network, the second convolutional neural network being a reciprocal process to the first convolutional neural network. The invention relates to a method for carrying out encryption operation on a whole image by utilizing a convolutional neural network, which belongs to a conventional technology.
Further, the training result of the first convolutional neural network on the input image is as follows: the dimension of the input image is reduced to 3 channels. The 3-channel data and the original high-dimensional image have larger difference, so that the encryption requirement is met, and meanwhile, the restoration is facilitated.
Further, the predetermined position is a central position. The features of the image are mostly concentrated at the central position, and the encryption method is adopted, so that the central position is determined to be encrypted, the most features of the original image can be hidden, and the encryption effect is good.
Further, the predetermined size is in a predetermined ratio to the size of the original image. The sizes of different original images are greatly different, a local encryption mode with a fixed size cannot achieve a good encryption effect for some original images, and an encryption area is determined in a mode proportional to the size of the original image, so that good encryption protection can be performed on different original images.
In order to solve all or part of the above problems, the present invention provides a method for implementing local encrypted image restoration in JavaScript, including:
in the local encrypted image, a local image with a larger range than the encrypted area is extracted at the position of the encrypted area;
intercepting an encrypted part from the extracted image, or intercepting an encrypted part from a local encrypted image; and restoring the encrypted part through a process reverse to the encryption process, and covering the restored image to the corresponding position in the scratched image to obtain a restored local image.
And restoring the position of the image which is restored to the local image and is scratched in the local encrypted image into the encrypted image.
The restoring method aims at restoring the locally encrypted image, is applied to JavaScript, and can greatly reduce the calculation cost in the JavaScript, so that the method can be realized in the JavaScript.
Further, the recovering the original local image to the encrypted image with the position of the extracted image in the local encrypted image specifically comprises: and restoring the partial image to zoom in the encrypted image at the zoom ratio of the display interface, and restoring the partial image to the zoomed encrypted image corresponding to the position of the scratched image in the encrypted image. This is to allow for the encrypted image to be scaled differently at different clients.
In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:
aiming at the problem that JavaScript computing resources are limited, the image encryption method and the image restoration method adopt a local encryption mode and an online restoration and display mode, can greatly reduce the computing overhead in the JavaScript, and realize the image encryption and the image restoration in the JavaScript.
Drawings
The invention will now be described, by way of example, with reference to the accompanying drawings, in which:
FIGS. 1-5 are an original image, an encrypted image, a scratched image, a restored local image, and a restored whole image in sequence.
Detailed Description
All of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations of features and/or steps that are mutually exclusive.
Any feature disclosed in this specification (including any accompanying claims, abstract) may be replaced by alternative features serving equivalent or similar purposes, unless expressly stated otherwise. That is, unless expressly stated otherwise, each feature is only an example of a generic series of equivalent or similar features.
Example one
The embodiment discloses a method for realizing image theft prevention in JavaScript, which comprises an image encryption step and an image restoration step:
an image encryption step: performing an encryption operation on a local area with a predetermined size and a predetermined position of the original image, wherein the encryption operation is as follows: the local area is subjected to reducible damage to obtain an encrypted image; in the encrypted image, the image at the local area position is different from the original image, as shown in fig. 1 and 2.
For example, a convolution neural network is adopted to perform encryption operation on a local area, and the image encryption steps correspond to: and performing encryption operation on a local area with a preset position and a preset size of the original image, wherein the encryption operation is to train the local area by using a first convolutional neural network to obtain an encrypted image, and the image at the position of the local area in the encrypted image is different from the original image. In general, the main features of an image are mainly concentrated on the central position of the image, and therefore, the predetermined position can be the central position of the original image. Considering that there is a large size difference between different original images, if an image is destroyed in a fixed size, it is impossible to encrypt the original image having a large size, and therefore, the predetermined size is determined in accordance with the width and height of the original image, that is, in accordance with the predetermined ratio (the predetermined ratio is inevitably smaller than 1) to the size of the original image.
And an image restoration step:
at the predetermined position in the encrypted image, the local image which is linear with the predetermined size and is larger than the predetermined size (smaller than the original image) is scratched, and the damaged area forms a scratched image like a Chinese character 'hui', as shown in fig. 3. The reason why the redundant part is needed to be extracted is that the webpage is zoomed when the image is displayed, and if only the encrypted part is extracted, the blue color of the damaged area is interpolated to the normal image, so that a blue color margin appears.
And intercepting the encrypted part from the intercepted image, or intercepting the encrypted part from the encrypted image, namely the image of a local area with a preset size corresponding to the preset position in the encrypted image. And performing a recovery operation on the intercepted encrypted part, wherein the recovery operation comprises the following steps: restoring by using a mode of inverse operation with the encryption operation, for example, inputting the intercepted encrypted part into a second convolution neural network forming an inverse process with the first convolution neural network in the encryption operation for restoring; and then covering the restored image to the corresponding position in the extracted image to obtain a restored local image, as shown in fig. 4. In the present invention, the convolutional neural network for destruction and restoration is not limited as long as the two are in a reciprocal relationship and can destroy and restore the image of the local region.
The position of the image restored with the partial image to be extracted in the encrypted image is restored to the encrypted image, so as to obtain the restored whole image, as shown in fig. 5.
In consideration of the situation that the display size of the encrypted image in the webpage is not consistent with the original size, because the display screen sizes corresponding to different clients, pc, android and the like are not consistent, when the restored partial image is restored to the encrypted image, the situation that the encrypted image is zoomed needs to be considered. The steps are specifically as follows: and zooming the restored partial image according to the zooming ratio of the encrypted image on the display interface, and restoring the restored partial image to the zoomed encrypted image corresponding to the position of the scratched image in the encrypted image. For the case where the encrypted image is not scaled, the scale is 1.
Example two
The embodiment discloses a method for realizing image theft prevention in JavaScript, which comprises an image encryption step and an image restoration step:
an image encryption step:
and performing encryption operation on a local area which is at the central position of the original image and has a preset proportion to the size of the original image, wherein the encryption operation is to train the local area by using a first convolutional neural network to obtain an encrypted image, and the image at the position of the local area in the encrypted image is different from the original image. Instead of irreversibly damaging the original image, the encryption operation hides or transforms the image features of the corresponding region, for example, the image of the local region is trained to be an image of RGB3 channel, as shown in fig. 2.
And an image restoration step:
and at the central position of the encrypted image, partial images larger than the preset proportion are scratched, and the scratched images are shown in figure 3.
Intercepting the encrypted part from the extracted local image, or intercepting the encrypted part from the encrypted image, inputting the intercepted part into a second convolution neural network for reduction, wherein the second convolution neural network and the first convolution neural network are in inverse operation, and then covering the reduced image to the corresponding position in the extracted local image to obtain a reduced local image, as shown in fig. 4.
The restored partial image is scaled according to the scaling of the encrypted image on the display interface, and the position of the scratched image in the encrypted image is restored to the scaled encrypted image, so as to obtain the restored whole image, as shown in fig. 5.
EXAMPLE III
The embodiment discloses a method for realizing local encrypted image restoration in JavaScript, which comprises the following steps:
in the local encrypted image, a local image with a larger range than the encrypted area is extracted at the position of the encrypted area;
intercepting an encrypted part from the extracted image, or intercepting an encrypted part from a local encrypted image; and restoring the encrypted part through a process reverse to the encryption process, and covering the restored image to the corresponding position in the scratched image to obtain a restored local image.
And restoring the position of the image which is restored to the local image and is scratched in the local encrypted image into the encrypted image.
Considering the situation of scaling the encrypted image, the process of restoring the restored image specifically includes: and restoring the partial image to zoom in the encrypted image at the zoom ratio of the display interface, and restoring the partial image to the zoomed encrypted image corresponding to the position of the scratched image in the encrypted image.
The invention is not limited to the foregoing embodiments. The invention extends to any novel feature or any novel combination of features disclosed in this specification and any novel method or process steps or any novel combination of features disclosed.

Claims (8)

1. A method for realizing image theft prevention in JavaScript is characterized by comprising an image encryption step and an image restoration step:
an image encryption step:
performing an encryption operation on a local area with a predetermined size and a predetermined position of the original image, wherein the encryption operation is as follows: the local area is subjected to reducible damage to obtain an encrypted image; in the encrypted image, the image at the position of a local area is different from the original image;
and an image restoration step:
at the preset position in the encrypted image, scratching a partial image which is in linear relation with the preset size and is larger than the preset size;
intercepting the encrypted part from the intercepted image, or intercepting the encrypted part from the encrypted image, and carrying out reduction operation on the intercepted encrypted part, wherein the reduction operation is as follows: restoring by using a mode of inverse operation with the encryption operation; covering the restored image to the corresponding position in the scratched image to obtain a restored local image;
and restoring the position of the image which is restored to the partial image to be scratched in the encrypted image into the encrypted image.
2. The method for preventing image burglary in JavaScript according to claim 1, wherein the overlaying of the restored image to the corresponding position in the scratched-out image specifically includes: and restoring the partial image to zoom in the encrypted image at the zoom ratio of the display interface, and restoring the partial image to the zoomed encrypted image corresponding to the position of the scratched image in the encrypted image.
3. The method for implementing image theft prevention in JavaScript according to claim 1 or 2, wherein the encryption operation is: training the local area by using a first convolutional neural network; the reduction operation comprises the following steps: training the encrypted portion using a second convolutional neural network, the second convolutional neural network being a reciprocal process to the first convolutional neural network.
4. The method for preventing image burglary in JavaScript of claim 3, wherein the training result of the first convolutional neural network on the input image is: the dimension of the input image is reduced to 3 channels.
5. The method for implementing image theft prevention in JavaScript as recited in claim 1, wherein the predetermined location is a central location.
6. The method for image anti-theft in JavaScript according to claim 1, wherein the predetermined size is in a predetermined ratio to a size of the original image.
7. A method for realizing local encrypted image restoration in JavaScript is characterized by comprising the following steps:
in the local encrypted image, a local image with a larger range than the encrypted area is extracted at the position of the encrypted area;
intercepting an encrypted part from the extracted image, or intercepting an encrypted part from a local encrypted image, restoring the encrypted part through a process reverse to the encryption process, and covering the restored image to a corresponding position in the extracted image to obtain a restored local image;
and restoring the position of the image which is restored to the local image and is scratched in the local encrypted image into the local encrypted image.
8. The method for realizing local encrypted image restoration in JavaScript according to claim 7, wherein the restoring the restored local image to the local encrypted image according to the position of the scratched image in the local encrypted image specifically includes: and restoring the partial image to zoom according to the zoom ratio of the partial encrypted image on the display interface, and restoring the partial encrypted image to the zoomed partial encrypted image corresponding to the position of the scratched image in the partial encrypted image.
CN202010510294.8A 2020-06-08 2020-06-08 Method for realizing image anti-theft and local encrypted image restoration in JavaScript Active CN111683190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010510294.8A CN111683190B (en) 2020-06-08 2020-06-08 Method for realizing image anti-theft and local encrypted image restoration in JavaScript

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010510294.8A CN111683190B (en) 2020-06-08 2020-06-08 Method for realizing image anti-theft and local encrypted image restoration in JavaScript

Publications (2)

Publication Number Publication Date
CN111683190A CN111683190A (en) 2020-09-18
CN111683190B true CN111683190B (en) 2022-04-19

Family

ID=72454890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010510294.8A Active CN111683190B (en) 2020-06-08 2020-06-08 Method for realizing image anti-theft and local encrypted image restoration in JavaScript

Country Status (1)

Country Link
CN (1) CN111683190B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101010905A (en) * 2004-09-07 2007-08-01 佳能株式会社 Information processing method, information processing device, computer program for achieving the information processing method, and computer-readable storage medium of storing the computer program
CN102708539A (en) * 2012-04-21 2012-10-03 上海量明科技发展有限公司 Method for obtaining image through twice-screenshot and client
CN106960157A (en) * 2017-03-15 2017-07-18 浙江大学 Digital image resolution classification obtains the implementation method of control manager
CN108989604A (en) * 2018-07-20 2018-12-11 京东方科技集团股份有限公司 Image encryption method, image transfer method, electronic equipment, readable storage medium storing program for executing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5071188B2 (en) * 2008-03-24 2012-11-14 富士通株式会社 Image encryption / decryption device and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101010905A (en) * 2004-09-07 2007-08-01 佳能株式会社 Information processing method, information processing device, computer program for achieving the information processing method, and computer-readable storage medium of storing the computer program
CN102708539A (en) * 2012-04-21 2012-10-03 上海量明科技发展有限公司 Method for obtaining image through twice-screenshot and client
CN106960157A (en) * 2017-03-15 2017-07-18 浙江大学 Digital image resolution classification obtains the implementation method of control manager
CN108989604A (en) * 2018-07-20 2018-12-11 京东方科技集团股份有限公司 Image encryption method, image transfer method, electronic equipment, readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN111683190A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
CN115997207B (en) Detecting a sub-image region of interest in an image using a pilot signal
US20060290950A1 (en) Image superresolution through edge extraction and contrast enhancement
Jung et al. Data hiding using edge detector for scalable images
US20230005114A1 (en) Image restoration method and apparatus
WO2021045781A1 (en) Detecting semi-transparent image watermarks
CN102473285A (en) Retargeting of image with overlay graphic
CN111179159B (en) Method and device for eliminating target image in video, electronic equipment and storage medium
Fu et al. Color image watermarking scheme based on linear discriminant analysis
US20120121086A1 (en) Image encryption/descryption device, method, and storage medium storing a program
Mhala et al. Contrast enhancement of progressive visual secret sharing (pvss) scheme for gray-scale and color images using super-resolution
JP2007241356A (en) Image processor and image processing program
WO2021027113A1 (en) Image verification method, device, computer apparatus, and storage medium
CN113870283B (en) Portrait matting method, device, computer equipment and readable storage medium
CN109391819B (en) Reversible information hiding method based on pixel value dynamic prediction
CN111683190B (en) Method for realizing image anti-theft and local encrypted image restoration in JavaScript
US20020171853A1 (en) Method and system for data hiding and authentication via halftoning and coordinate projection
CN113762235A (en) Method and device for detecting page overlapping area
Vigila et al. Hiding of Confidential Data in Spatial Domain Images using Image Interpolation.
Kim et al. Robust watermarking in curvelet domain for preserving cleanness of high-quality images
EP4047547A1 (en) Method and system for removing scene text from images
CN114549270A (en) Anti-shooting monitoring video watermarking method combining depth robust watermarking and template synchronization
KR102347137B1 (en) Screen data leakage prevention apparatus and method
CN115270084A (en) Blind watermark encryption implementation method based on screenshot information protection
Lu et al. Reversible steganography techniques: A survey
CN114140805A (en) Image processing method, image processing device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 312000, Building A-208, No.1 Tianhuangping Road, Tianhuangping Town, Anji County, Huzhou City, Zhejiang Province, China (self declared)

Patentee after: Huzhou Yunti Technology Co.,Ltd.

Country or region after: China

Address before: Room 3013, block a, new era Internet Plaza, 669 Fengtan Road, Xihu District, Hangzhou City, Zhejiang Province 310011

Patentee before: Hangzhou Yunti Technology Co.,Ltd.

Country or region before: China