一种支持隐私保护功能的图像区域复制检测方法Image area copy detection method supporting privacy protection function
技术领域Technical field
本发明涉及数字图像取证领域,特别涉及一种支持隐私保护功能的图像区域复制检测方法。The present invention relates to the field of digital image forensics, and in particular, to a method for detecting copying of an image area supporting a privacy protection function.
背景技术Background technique
区域复制是将图像中一部分拷贝到其他位置,以达到掩盖图像中某些物体,或是强调某些内容的目的,是最常见的图像篡改技术。对该类图像篡改的取证通常需要在图像中找到多个高度相似的区域,这些区域的相似度将明显超过正常自然图像,以此作为篡改的证据,并定位篡改区域。将区域复制取证外包给云,由云服务器来提供取证服务是一种经济有效的解决方案,但随之也带来了隐私泄露的风险。用户需要取证的图像数据经常包含敏感内容,而且用户和图像内容也经常存在着利益关系。这些信息通常用户不希望泄露给数字取证云服务提供方。另一方面,云平台的计算资源共享更加剧了数据外泄的安全隐患。而现有的图像区域复制篡改取证操作只能在明文下进行,因此面临图像内容泄漏的风险。如何在区域复制取证外包服务中保护图像数据的安全和隐私,成为了决定图像取证外包能否实际应用的一个重要因素。Area copy is the most common image tampering technique to copy part of the image to other locations to cover some objects in the image or emphasize some content. Forensics of this type of image tampering usually requires finding multiple highly similar areas in the image, and the similarity of these areas will obviously exceed the normal natural image as evidence of tampering and locate the tampered area. Outsourcing regional forensics to the cloud, and cloud servers to provide forensic services is a cost-effective solution, but it also brings the risk of privacy leakage. The image data that users need to forensic often contain sensitive content, and there is often an interest relationship between users and image content. This information is usually not intended to be leaked to digital forensics cloud service providers. On the other hand, the sharing of computing resources on cloud platforms has exacerbated the security risks of data leakage. However, the existing image area copying, tampering and forensics operations can only be performed in plain text, and therefore face the risk of image content leakage. How to protect the security and privacy of image data in regional copy forensics outsourcing services has become an important factor in determining whether image forensics outsourcing can be practically applied.
发明内容Summary of the Invention
本发明的目的在于克服现有技术的缺点与不足,提供一种支持隐私保护功能的图像区域复制检测方法,用户端可以将密文形式的图像发送给云服务端,云服务端在不知晓图像内容的前提下,提供有效的区域复制取证服务,实现对篡改操作的检测和定位。相比于传统区域复制取证工具或服务,本发明可以提供用户图像内容的隐私保护。The purpose of the present invention is to overcome the shortcomings and shortcomings of the prior art, and to provide an image area copy detection method that supports the privacy protection function. The user terminal can send the image in cipher text to the cloud server. The cloud server does not know the image. Under the premise of the content, it provides effective regional copying and forensics services to detect and locate tampering operations. Compared with the traditional area copying forensics tool or service, the present invention can provide privacy protection of user image content.
本发明的目的通过以下的技术方案实现:一种支持隐私保护功能的图像区域复制检测方法,包括:用户端,N个相互独立的云服务端,其中部分服务端用于密文存储,部分服务端用于密文计算;用户端利用图像加密算法将图像分拆为多个密文,分别交给用于密文存储的服务端,由这些服务端和用于密文计算的服务端通过交互和计算完成密文空间下对图像区域复制篡改操作的检测和定位;最后每个用于密文存储的服务端均获得疑似篡改区域,用于密文存储的服务端将结果发送给用户端。The object of the present invention is achieved by the following technical solution: a method for detecting the copy of an image area supporting a privacy protection function, comprising: a user terminal, N mutually independent cloud server terminals, some of which are used for ciphertext storage, and some services The end is used for ciphertext calculation; the user end uses the image encryption algorithm to split the image into multiple ciphertexts and hand them over to the server for ciphertext storage. These servers interact with the server for ciphertext calculation through interaction. The detection and positioning of the image tampering operation in the ciphertext space are completed with calculation. Finally, each server for ciphertext storage obtains the suspected tampering area, and the server for ciphertext storage sends the result to the user.
优选的,包括1个用户端
3个相互独立的云服务端,其中2个服务端,
和
用于 密文存储,1个服务端
用于密文计算;
利用图像加密算法将图像分拆为两个密文,分别交给
和
由这两个服务端和
通过交互和计算完成密文空间下对图像区域复制篡改操作的检测和定位;最后
和
均获得疑似篡改区域,
和
将结果发送给
Preferably, includes 1 client 3 independent cloud servers, 2 of them, with For ciphertext storage, 1 server For ciphertext calculations; Use image encryption algorithm to split the image into two ciphertexts with By these two servers and Detecting and locating the tampering operation of the image area in ciphertext space through interaction and calculation; finally with All obtained suspected tampered areas, with Send results to
具体的,检测方法包括以下步骤:Specifically, the detection method includes the following steps:
S1、用户端
图像密文生成步骤;
S1, client Image ciphertext generation step;
S2、云服务端
和
的密文空间下篡改区域检测与定位步骤;
S2, cloud server with Detection and location steps of tampered area in ciphertext space;
S2-1、计算Harris角点;S2-1. Calculate Harris corner;
S2-2、提取兴趣点描述子;S2-2, extracting a point of interest descriptor;
S2-3、兴趣点匹配;S2-3. Points of interest match;
S2-4、篡改区域定位;S2-4. Tampering with the positioning of the area;
S3、用户端
获得检测结果和疑似篡改区域。
S3, client Obtain detection results and suspected tampered areas.
优选的,步骤S1,用户端
图像密文生成步骤包括:
Preferably, in step S1, the client The image ciphertext generation steps include:
计算前,
拥有一l
m×l
m大小的待检测图像X;
Before calculation, Have an image to be inspected X with a size of l m × l m ;
步骤1:
选择一l
m×l
m大小的随机数矩阵R,其每个元素为0~2
10之间的随机数;生成2份图像密文:
step 1: Select a random number matrix R of size l m × l m , each element of which is a random number between 0 and 2 10 ; generate 2 copies of the image ciphertext:
I
(1)=X+R,I
(2)=R
I (1) = X + R, I (2) = R
步骤2:
将I
(1)通过安全信道发送给
将I
(2)通过安全信道发送给
Step 2: Send I (1) to the secure channel Send I (2) over the secure channel to
计算后,
拥有密文I
(1),
拥有密文I
(2)。
After calculation, Owns the ciphertext I (1) , Owns the ciphertext I (2) .
优选的,步骤S2-1,计算Harris角点具体包括:Preferably, in step S2-1, calculating the Harris corner specifically includes:
计算前,
拥有图像密文I
(1),
拥有图像密文I
(2),
和
共享密钥集
Before calculation, Has image ciphertext I (1) , Has image ciphertext I (2) , with Shared key set
步骤1:
计算
step 1: Calculation
步骤2:
和
交互计算
计算后
拥有
拥有
Step 2: with Interactive computing After calculation have have
步骤3:
和
交互计算
计算后
拥有
拥有
Step 3: with Interactive computing After calculation have have
步骤4:
和
交互计算
计算后
拥有
拥有
Step 4: with Interactive computing After calculation have have
步骤5:
和
交互计算
计算后
拥有
拥有
Step 5: with Interactive computing After calculation have have
步骤6:
计算
其中h为Gaussian滤波核;
Step 6: Calculation Where h is the Gaussian filter kernel;
步骤7:
和
交互计算
计算后
拥有
拥有
Step 7: with Interactive computing After calculation have have
步骤8:
和
交互计算
计算后
拥有
拥有
Step 8: with Interactive computing After calculation have have
步骤9:
和
交互计算
计算后
拥有
拥有
Step 9: with Interactive computing After calculation have have
步骤10:
和
交互计算
计算后
拥有
拥有
Step 10: with Interactive computing After calculation have have
步骤11:
和
交互计算
计算后
拥有A
(1),
拥有A
(2);
Step 11: with Interactive computing After calculation Owns A (1) Owns A (2) ;
步骤12:
计算
其中t为Harris角点检查常数;
Step 12: Calculation Where t is the Harris corner check constant;
步骤13:
和
各生成一个l
m×l
m大小的全零矩阵H,用于存放Harris角点;对所有的i和j,
密文形式下计算系数块U
(1)(8i+1:8i+8,8j+1:8j+8)和U
(2)(8i+1:8i+8,8j+1:8j+8)对应的明文U(8i+1:8i+8,8j+1:8j+8)的局部最小值, 方法为:
Step 13: with Generate an all-zero matrix H of size l m × l m for storing Harris corners; for all i and j, Calculate coefficient blocks U (1) (8i + 1: 8i + 8,8j + 1: 8j + 8) and U (2) (8i + 1: 8i + 8,8j + 1: 8j + 8) in ciphertext form The corresponding local minimum of the plaintext U (8i + 1: 8i + 8,8j + 1: 8j + 8), the method is:
步骤13-1:
和
均令θ
m=8i+1,θ
n=8j+1;
Step 13-1: with Let θ m = 8i + 1, θ n = 8j + 1 both;
步骤13-2:对所有的8i+1<m≤8i+8,8j+1<n≤8j+8,
和
交互计算b=SCP(U
(1)(θ
m,θ
n)-U
(1)(m,n),U
(2)(θ
m,θ
n)-U
(2)(m,n)),计算后
和
均拥有b;若b=0,
和
均令θ
m=m,θ
n=n;
Step 13-2: For all 8i + 1 <m≤8i + 8, 8j + 1 <n≤8j + 8 with Interactive calculation b = SCP (U (1) (θ m , θ n ) -U (1) (m, n), U (2) (θ m , θ n ) -U (2) (m, n)) After calculation with Both have b; if b = 0, with Let θ m = m and θ n = n both;
步骤13-3:
和
均令H(θ
m,θ
n)=1;
Step 13-3: with Let H (θ m , θ n ) = 1;
计算后,
和
均拥有检测到的Harris角点H。
After calculation, with Each has a detected Harris corner H.
优选的,步骤S2-2,提取兴趣点描述子具体包括:Preferably, in step S2-2, extracting the point of interest descriptor specifically includes:
计算前,
拥有图像密文I
(1),检测到的Harris角点H,
拥有图像密文I
(2),检测到的Harris角点H
Before calculation, Have image ciphertext I (1) , Harris corner H detected, Own image ciphertext I (2) , Harris corner H detected
步骤1:
生成一个l
m×l
m×49大小的三维全零矩阵D
(1),
生成一同样大小的三维全零矩阵D
(2),均用来存放兴趣点描述子;
step 1: Generate a three-dimensional all-zeros matrix D (1) of size l m × l m × 49, Generate a three-dimensional all-zero matrix D (2) of the same size, which is used to store the descriptors of points of interest;
步骤2:对于所有的满足H(i,j)=1的i和j,密文形式下计算兴趣点描述子,方法为:Step 2: For all i and j that satisfy H (i, j) = 1, calculate the point of interest descriptor in ciphertext form:
步骤2-1:
计算
其中FFT()表示快速Fourier变换,LPM()表示log-polar映射,
表示I
(1)中以(i,j)为中心的7×7的像素块;
Step 2-1: Calculation Where FFT () represents fast Fourier transform and LPM () represents log-polar mapping Represents a 7 × 7 pixel block with (i, j) as the center in I (1) ;
计算
其中
表示I
(2)中以(i,j)为中心的7×7的像素块;
Calculation among them Represents a 7 × 7 pixel block centered at (i, j ) in I (2) ;
步骤2-2:
令D
(1)(i,j,:)=[F
(1)(1,1),…,F
(1)(1,7),…,F
(1)(7,1),…,F
(1)(7,7)];
Step 2-2: Let D (1) (i, j, :) = [F (1) (1,1), ..., F (1) (1,7), ..., F (1) (7,1), ..., F (1) (7,7)];
令D
(2)(i,j,:)=[F
(2)(1,1),…,F
(2)(1,7),…,F
(2)(7,1),…,F
(2)(7,7)]。
Let D (2) (i, j, :) = [F (2) (1,1), ..., F (2) (1,7), ..., F (2) (7,1), ..., F (2) (7,7)].
计算后,
拥有密文形式的兴趣点描述子D
(1),
拥有密文形式的兴趣点描述子D
(2)。
After calculation, Has a point of interest descriptor D (1) in cipher text, The point-of-interest descriptor D (2) in ciphertext form.
优选的,步骤S2-3,兴趣点匹配具体包括:Preferably, in step S2-3, the interest point matching specifically includes:
计算前,
拥有密文形式的兴趣点描述子D
(1),
拥有密文形式的兴趣点描述子D
(2),
和
均拥有控制参数α和β,共享密钥集
Before calculation, Has a point of interest descriptor D (1) in cipher text, Has a point of interest descriptor D (2) in ciphertext, with Both have control parameters α and β, shared key set
步骤1:
生成一个l
D×6大小的矩阵T
(1),其中l
D是D
(1)(i,j,:)≠0的所有(i,j)的个数,
生成一个同样大小的矩阵T
(2),注意D
(1)(i,j,:)≠0的(i,j)一定同时满足D
(2)(i,j,:)≠0;
step 1: Generate a l D × 6 matrix T (1) , where l D is the number of all (i, j) with D (1) (i, j, :) ≠ 0, Generate a matrix T (2) of the same size. Note that (i, j ) with D (1) (i, j, :) ≠ 0 must also satisfy D (2) (i, j, :) ≠ 0;
步骤2:用p表示当前匹配的特征点的索引,
和
均从第一个特征点开始匹配,即令p=1,找到满足D
(1)(i,j,:)≠0的最小的i和对应的j;
Step 2: Use p to represent the index of the currently matched feature points, with Both start from the first feature point, that is, let p = 1, find the smallest i and corresponding j that satisfy D (1) (i, j, :) ≠ 0;
步骤3:密文形式下寻找与(i,j)处描述子最近临的描述子及其位置,方法为:Step 3: In cipher text form, find the descriptor closest to the descriptor at (i, j) and its location. The method is:
步骤3-1:
令T
(1)(p,1)=i,T
(1)(p,2)=j,若存在q<p满足T
(1)(q,3)=i,T
(1)(q,4)=j,则令T
(1)(p,3)=T
(1)(q,1),T
(1)(p,4)=T
(1)(q,2),T
(1)(p,5)=T
(1)(q,5),否则令T
(1)(p,5)=inf;
Step 3-1: Let T (1) (p, 1) = i, T (1) (p, 2) = j, if q <p satisfies T (1) (q, 3) = i, T (1) (q, 4) = j, then let T (1) (p, 3) = T (1) (q, 1), T (1) (p, 4) = T (1) (q, 2), T (1 ) (p, 5) = T (1) (q, 5), otherwise let T (1) (p, 5) = inf;
令T
(2)(p,1)=i,T
(2)(p,2)=j,若存在q<p满足T
(2)(q,3)=i,T
(2)(q,4)=j,则令T
(2)(p,3)=T
(2)(q,1),T
(2)(p,4)=T
(2)(q,2),T
(2)(p,5)=T
(2)(q,5),否则令T
(1)(p,5)=0;
Let T (2) (p, 1) = i, T (2) (p, 2) = j, if q <p satisfies T (2) (q, 3) = i, T (2) (q, 4) = j, then let T (2) (p, 3) = T (2) (q, 1), T (2) (p, 4) = T (2) (q, 2), T (2 ) (p, 5) = T (2) (q, 5), otherwise let T (1) (p, 5) = 0;
步骤3-2:对于任意(i′,j′),如果满足D
(1)(i′,j′,:)≠0&&(i′>i||j′>j)&&((i′-i)
2+(j′-j)
2)>α,密文形式下判断该位置处描述子是否和(i,j)处描述子最近,方法为:
Step 3-2: For any (i ′, j ′), if D (1) (i ′, j ′, :) ≠ 0 && (i ′> i || j ′> j) && ((i′- i) 2 + (j′-j) 2 )> α, to determine whether the descriptor at this position is closest to the descriptor at (i, j) in cipher text, the method is:
步骤3-2-1:
和
交互计算
计算后
拥有
拥有
Step 3-2-1: with Interactive computing After calculation have have
步骤3-2-2:
和
交互计算
计算后
拥有
拥有
Step 3-2-2: with Interactive computing After calculation have have
步骤3-2-3:
和
交互计算
计算后
拥有
拥有
Step 3-2-3: with Interactive computing After calculation have have
步骤3-2-4:
和
交互计算
计算后
拥有
拥有
Step 3-2-4: with Interactive computing After calculation have have
步骤3-2-5:
计算
Step 3-2-5: Calculation
步骤3-2-6:
计算u
(1)=(U
(1)(1)+…+U
(1)(49));
Step 3-2-6: Calculate u (1) = (U (1) (1) + ... + U (1) (49));
计算u
(2)=(U
(2)(1)+…+U
(2)(49));
Calculate u (2) = (U (2) (1) + ... + U (2) (49));
步骤3-2-7:
和
交互计算b=SCP(T
(1)(p,5)-u
(1),T
(2)(p,5)-u
(2)),计算后
和
均拥有b;
Step 3-2-7: with Interactive calculation b = SCP (T (1) (p, 5) -u (1) , T (2) (p, 5) -u (2) ), after calculation with Both have b;
步骤3-2-8:如果b=1,
令T
(1)(p,3)=,T
(1)(p,4)=j′,T
(1)(p,6)=T
(1)(p,5),T
(1)(p,5)=u
(1),
令T
(2)(p,3)=i′,T
(2)(p,4)=j′,T
(2)(p,6)=T
(2)(p,5),T
(2)(p,5)=u
(2)。
Step 3-2-8: If b = 1, Let T (1) (p, 3) =, T (1) (p, 4) = j ', T (1) (p, 6) = T (1) (p, 5), T (1) ( p, 5) = u (1) , Let T (2) (p, 3) = i ', T (2) (p, 4) = j', T (2) (p, 6) = T (2) (p, 5), T (2 ) (p, 5) = u (2) .
步骤3-3:
和
交互计算b=SCP(T
(1)(p,5)×β-T
(1)(p,6),T
(2)(p,5)×β-T
(2)(p,6)),计算后
和
均拥有b;
Step 3-3: with Interactive calculation b = SCP (T (1) (p, 5) × β-T (1) (p, 6), T (2) (p, 5) × β-T (2) (p, 6)) After calculation with Both have b;
步骤3-4:如果b=1,
令T
(1)(p,3)=0,T
(1)(p,4)=0,T
(1)(p,5)=inf,
Step 3-4: If b = 1, Let T (1) (p, 3) = 0, T (1) (p, 4) = 0, T (1) (p, 5) = inf,
令T
(2)(p,3)=0,T
(2)(p,4)=0,T
(2)(p,5)=0;
Let T (2) (p, 3) = 0, T (2) (p, 4) = 0, T (2) (p, 5) = 0;
步骤4:寻找满足D
(1)(i′,j′,:)≠0&&(i′>i||j′>j)的最小的i′和对应的j′,若存在,
和
均令p=p+1,i=i′,j=j′,返回步骤3重新执行,否则转至步骤5;
Step 4: Find the smallest i ′ and corresponding j ′ that satisfy D (1) (i ′, j ′, :) ≠ 0 && (i ′> i || j ′> j), if they exist, with Let p = p + 1, i = i ′, j = j ′, return to step 3 and execute again, otherwise go to step 5;
步骤5:密文形式下对T
(1)和T
(2)对应的明文T按照T(:,5)的大小重排序;
Step 5: The plaintext T corresponding to T (1) and T (2) is reordered in the cipher text form according to the size of T (:, 5);
步骤6:对于所有l
D≥i>1,如果(T
(1)(i,1)>T
(1)(i,3)||T
(1)(i,2)>T
(1)(i,4)),则
交 互T
(1)(i,1)和T
(1)(i,3),T
(1)(i,2)和T
(1)(i,4);
Step 6: For all l D ≥i> 1, if (T (1) (i, 1)> T (1) (i, 3) || T (1) (i, 2)> T (1) ( i, 4)), then Interacting T (1) (i, 1) and T (1) (i, 3), T (1) (i, 2) and T (1) (i, 4);
如果(T
(2)(i,1)>T
(2)(i,3)||T
(2)(i,2)>T
(2)(i,4)),则
交互T
(2)(i,1)和T
(2)(i,3),T
(2)(i,2)和T
(2)(i,4);
If (T (2) (i, 1)> T (2) (i, 3) || T (2) (i, 2)> T (2) (i, 4)), then Interacting T (2) (i, 1) and T (2) (i, 3), T (2) (i, 2) and T (2) (i, 4);
步骤7:如果存在l
D≥i>j满足T
(1)(i,:)=T
(1)(j,:),则
删去T
(1)(i,:);
Step 7: If l D ≥i> j satisfies T (1) (i,:) = T (1) (j, :), then Delete T (1) (i, :);
如果存在l
D≥i>j满足T
(2)(i,:)=T
(2)(j,:),则
删去T
(2)(i,:);
If l D ≥i> j satisfies T (2) (i, :) = T (2) (j, :), then Delete T (2) (i, :);
计算后,
拥有密文形式的排序好的p个匹配特征点T
(1),
拥有密文形式的排序好的p个匹配特征点T
(2)。
After calculation, Ranked p matching feature points T (1) in ciphertext form, Ranked p matching feature points T (2) in ciphertext form.
优选的,密文形式下对T
(1)和T
(2)对应的明文T按照T(:,5)的大小重排序,方法为:
Preferably, the plaintext T corresponding to T (1) and T (2) in the cipher text form is reordered according to the size of T (:, 5) by the method:
步骤5-1:
和
均令i=1;
Step 5-1: with Let i = 1;
步骤5-2:密文形式下求得T(i:l
D,5)的最小值的位置,方法为:
Step 5-2: Find the position of the minimum value of T (i: l D , 5) in ciphertext form, the method is:
步骤5-2-1:
和
均令θ=i;
Step 5-2-1: with Let θ = i;
步骤5-2-2:对于所有的l
D≥i′>i,
和
交互计算b=SCP(T
(1)(θ,5)-T
(1)(i′,5),T
(2)(θ,5)-T
(2)(i′,5)),计算后
和
均拥有b;若b=1,
和
均令θ=i′;
Step 5-2-2: For all l D ≥i ′> i, with Interactive calculation b = SCP (T (1) (θ, 5) -T (1) (i ′, 5), T (2) (θ, 5) -T (2) (i ′, 5)), calculate Rear with Both have b; if b = 1, with Let θ = i ′;
步骤5-3:
交换T
(1)(θ,:)和T
(1)(i,:);
交换T
(2)(θ,:)和T
(2)(i,:);
Step 5-3: Exchange T (1) (θ, :) and T (1) (i, :); Exchange T (2) (θ, :) and T (2) (i, :);
步骤5-4:
和
均令i=i+1,若i≤l
D,返回步骤5-2重新执行,否则转至步骤6。
Step 5-4: with Let i = i + 1, if i ≤ l D , return to step 5-2 and execute again, otherwise go to step 6.
优选的,步骤S2-4,篡改区域定位具体包括:Preferably, in step S2-4, the location of the tampering area specifically includes:
计算前,
p=1,2,拥有密文形式的排序好的匹配特征点T
(1),
拥有控制参数γ和δ;
Before calculation, p = 1,2, with sorted matching feature points T (1) in ciphertext form, Have control parameters γ and δ;
步骤1:
生成l
m×l
m大小的全零矩阵E,并令i=1;
step 1: Generate an all-zero matrix E of size l m × l m , and let i = 1;
步骤2:
寻找与T
(1)(i,:)位置满足距离小于γ的点的个数,方法为:
Step 2: Find the number of points that satisfy the distance less than γ from the T (1) (i, :) position by the method:
步骤2-1:
令n=0,j=i+1,集合ε={i};
Step 2-1: Let n = 0, j = i + 1, and set ε = {i};
步骤2-2:
计算a=(T
(1)(i,1)-T
(1)(j,1))
2+(T
(1)(i,2)-T
(1)(j,2))
2,b=(T
(1)(i,3)-T
(1)(j,3))
2+(T
(1)(i,4)-T
(1)(j,4))
2;
Step 2-2: Calculate a = (T (1) (i, 1) -T (1) (j, 1)) 2 + (T (1) (i, 2) -T (1) (j, 2)) 2 , b = (T (1) (i, 3) -T (1) (j, 3)) 2 + (T (1) (i, 4) -T (1) (j, 4)) 2 ;
步骤2-3:若满足a>γ&&b>r/2&&b<2r,则
令n=n+1,ε=ε+{j};
Step 2-3: If a> γ &&b> r / 2 && b <2r is satisfied, then Let n = n + 1, ε = ε + {j};
步骤2-4:令j=j+1,若j≤l
D,返回步骤2-2重新执行,否则转至步骤3;
Step 2-4: Let j = j + 1, if j≤l D , return to step 2-2 and execute again, otherwise go to step 3;
步骤3:若n≥δ,则对于所有的j∈ε
1,
令E(T
(1)(j,1),T
(1)(j,2))=i,E(T
(1)(j,3),T
(1)(j,4))=-i;
Step 3: If n≥δ, then for all j∈ε 1 , Let E (T (1) (j, 1), T (1) (j, 2)) = i, E (T (1) (j, 3), T (1) (j, 4)) =- i;
步骤4:
寻找将所有E(j,k)=i的点(j,k)包含起来的最小圆形,并获得所有位于圆形内部的点(j′,k′),
令E(j′,k′)=i;
Step 4: Find the smallest circle that includes all points (j, k) where E (j, k) = i, and get all points (j ′, k ′) located inside the circle Let E (j ′, k ′) = i;
步骤5:
寻找将所有E(j,k)=-i的点(j,k)包含起来的最小圆形,并获得所有位于圆形内部的点(j′,k′),
令E(j′,k′)=-i;
Step 5: Find the smallest circle that includes all points (j, k) where E (j, k) = -i, and obtain all points (j ′, k ′) located inside the circle Let E (j ′, k ′) =-i;
步骤6:令i=i+1,若i≤5,返回步骤2-3重新执行,否则结束执行;Step 6: Let i = i + 1, if i≤5, return to step 2-3 and execute again, otherwise end execution;
计算后,
p=1,2,拥有疑似篡改区域E。
After calculation, p = 1, 2 and has a suspected tampering area E.
优选的,步骤S3,用户端
获得检测结果和疑似篡改区域具体包括:
Preferably, in step S3, the client Obtaining detection results and suspected tampering areas include:
计算前,
拥有疑似篡改区域E,拼接的两个区域分布被标注为i和-i,i∈{1,…,5};
Before calculation, With the suspected tampering area E, the two areas of the stitching are labeled as i and -i, i ∈ {1, ..., 5}
步骤1:
将E通过安全信道发送给
step 1: Send E over a secure channel to
计算后,
拥有疑似篡改区域E。
After calculation, Possess suspected tampering area E.
本发明与现有技术相比,具有如下优点和有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:
1、本发明提供了具有隐私保护能力的图像区域复制取证方法,服务端可以在不知晓图像内容的前提下实现对图像区域复制操作的检测和疑似篡改区域的定位,该效果是本发明使用的图像加密技术和提出的基于多方安全计算的取证算法带来的。1. The present invention provides a method for forensic copying of image areas with privacy protection capabilities. The server can detect the copy operation of the image area and locate the suspected tampering area without knowing the content of the image. Image encryption technology and the proposed forensic algorithm based on multi-party secure computing.
2、本发明提供的取证方法具有较高的计算效率和较好的精确度,该效果是本发明提出的计算量较低的图像取证流程、安全多方乘法协议、安全多方比较协议带来的。由于在区域定 位操作同时定位了多个区域,本发明可用于检测具有多个复制区域的篡改图像。2. The forensic method provided by the present invention has higher calculation efficiency and better accuracy, and the effect is brought about by the image forensics flow, the secure multi-party multiplication protocol, and the secure multi-party comparison protocol, which are proposed by the present invention, and have a relatively low calculation amount. Since multiple regions are located simultaneously in the region positioning operation, the present invention can be used to detect a tampered image with multiple copied regions.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是实施例方法整体流程图。FIG. 1 is an overall flowchart of the method of the embodiment.
图2是拼接区域篡改定位计算流程图。FIG. 2 is a flowchart of tampering positioning calculation of a stitching region.
具体实施方式detailed description
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention is described in further detail below with reference to the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
实施例1Example 1
本发明结合多方安全计算、图像兴趣点描述子提取和最近邻搜索技术,以在保护图像内容隐私的前提下,实现图像区域复制的检测和定位。为了实现图像内容的保密,本发明使用图像加密将图像分拆为两个图像密文。为了在满足隐私保护的前提下实现图像取证,本发明设计基于安全多方计算的取证算法,通过3个服务端的交互,来实现在不知晓对方密文的前提下,提取兴趣点描述子,并寻找最匹配描述子。为了保证算法执行的效率和准确率,本发明设计了简单的图像取证流程和安全多方计算协议。The invention combines multi-party secure computing, image interest point descriptor extraction, and nearest neighbor search technologies to realize the detection and location of image region replication on the premise of protecting the privacy of image content. In order to achieve the confidentiality of image content, the present invention uses image encryption to split the image into two image ciphertexts. In order to achieve image forensics under the premise of privacy protection, the present invention designs a forensic algorithm based on secure multi-party calculations. Through the interaction of three servers, it can extract the interest point descriptor without knowing the ciphertext of the other party, and find Best match descriptor. In order to ensure the efficiency and accuracy of algorithm execution, the present invention designs a simple image forensics process and a secure multi-party computing protocol.
本实施例中存在4个个体:1个用户端
3个相互独立的云服务端,其中2个服务端,
和
用于密文存储,1个服务端,
用于密文计算,如图1所示。
利用图像加密算法将图像分拆为两个密文,分别交给
和
由这两个服务端和
通过交互和计算完成密文空间下对图像区域复制篡改操作的检测和定位。最后
和
均获得疑似篡改区域,
和
将结果发送给
There are 4 individuals in this embodiment: 1 client 3 independent cloud servers, 2 of them, with Used for ciphertext storage, 1 server, Used for ciphertext calculation, as shown in Figure 1. Use the image encryption algorithm to split the image into two ciphertexts and hand them over to with By these two servers and The detection and location of the image tampering operation in the ciphertext space are completed through interaction and calculation. At last with All obtained suspected tampered areas, with Send results to
本实施方案中,用大写字母(如I,J)表示矩阵,用粗体小写字母(如i,j)表示向量,用斜体小写字母(如i,j)表示数,所有的乘法均是按元素乘,如有C=AB,则C中每个元素C(i,j)=A(i,j)×B(i,j)。A*B表示A和B的卷积。具体实施流程如下:In this embodiment, uppercase letters (such as I, J) represent matrices, bold lowercase letters (such as i, j) represent vectors, and italic lowercase letters (such as i, j) represent numbers. All multiplications are performed according to Element multiplication, if C = AB, then each element in C C (i, j) = A (i, j) × B (i, j). A * B represents the convolution of A and B. The specific implementation process is as follows:
一、用户端
图像密文生成流程
First, the client Image ciphertext generation process
计算前,
拥有一l
m×l
m大小的待检测图像X。
Before calculation, Have an image X to be detected with a size of l m × l m .
步骤1:
选择一l
m×l
m大小的随机数矩阵R,其每个元素为0~2
10之间的随机数。生成2份图像密文:
step 1: L select a random number R m × l m matrix size, each element of a random number between 0 and 210. Generate 2 image ciphertexts:
I
(1)=X+R,I
(2)=R
I (1) = X + R, I (2) = R
步骤2:
将I
(1)通过安全信道发送给
将I
(2)通过安全信道发送给
Step 2: Send I (1) to the secure channel Send I (2) over the secure channel to
计算后,
拥有密文I
(1),
拥有密文I
(2)。
After calculation, Owns the ciphertext I (1) , Owns the ciphertext I (2) .
二、云服务端
和
的密文空间下篡改区域检测与定位流程
Cloud server with Detection and localization process of tampered area in ciphertext space
(1)计算Harris角点:(1) Calculate Harris Corner:
计算前,
拥有图像密文I
(1),
拥有图像密文I
(2),
和
共享密钥集
Before calculation, Has image ciphertext I (1) , Has image ciphertext I (2) , with Shared key set
步骤1:
计算
step 1: Calculation
步骤2:
和
交互计算
计算后
拥有
拥有
Step 2: with Interactive computing After calculation have have
步骤3:
和
交互计算
计算后
拥有
拥有
Step 3: with Interactive computing After calculation have have
步骤4:
和
交互计算
计算后
拥有
拥有
Step 4: with Interactive computing After calculation have have
步骤5:
和
交互计算
计算后
拥有
拥有
Step 5: with Interactive computing After calculation have have
步骤6:
计算
其中h为Gaussian滤波核;
Step 6: Calculation Where h is the Gaussian filter kernel;
步骤7:
和
交互计算
计算后
拥有
拥有
Step 7: with Interactive computing After calculation have have
步骤8:
和
交互计算
计算后
拥有
拥有
Step 8: with Interactive computing After calculation have have
步骤9:
和
交互计算
计算后
拥有
拥有
Step 9: with Interactive computing After calculation have have
步骤10:
和
交互计算
计算后
拥有
拥有
Step 10: with Interactive computing After calculation have have
步骤11:
和
交互计算
计算后
拥有A
(1),
拥有A
(2);
Step 11: with Interactive computing After calculation Owns A (1) Owns A (2) ;
步骤12:
计算
其中t为Harris角点检查常数,一般取在0.04-0.06间;
Step 12: Calculation Where t is the Harris corner check constant, which is generally taken between 0.04-0.06;
步骤13:
和
各生成一个l
m×l
m大小的全零矩阵H,用于存放Harris角点。对所有的i和j,
密文形式下计算系数块U
(1)(8i+1:8i+8,8j+1:8j+8)和U
(2)(8i+1:8i+8,8j+1:8j+8)对应的明文U(8i+1:8i+8,8j+1:8j+8)的局部最小值,方法为:
Step 13: with An all-zero matrix H of size l m × l m is generated for storing Harris corner points. For all i and j, Calculate coefficient blocks U (1) (8i + 1: 8i + 8,8j + 1: 8j + 8) and U (2) (8i + 1: 8i + 8,8j + 1: 8j + 8) in ciphertext form The corresponding local minimum of plaintext U (8i + 1: 8i + 8,8j + 1: 8j + 8).
步骤13-1:
和
均令θ
m=8i+1,θ
n=8j+1;
Step 13-1: with Let θ m = 8i + 1, θ n = 8j + 1 both;
步骤13-2:对所有的8i+1<m≤8i+8,8j+1<n≤8j+8,
和
交互计算b=SCP(U
(1)(θ
m,θ
n)-U
(1)(m,n),U
(2)(θ
m,θ
n)-U
(2)(m,n)),计算后
和
均拥有b;若b=0,
和
均令θ
m=m,θ
n=n;
Step 13-2: For all 8i + 1 <m≤8i + 8, 8j + 1 <n≤8j + 8, with Interactive calculation b = SCP (U (1) (θ m , θ n ) -U (1) (m, n), U (2) (θ m , θ n ) -U (2) (m, n)) After calculation with Both have b; if b = 0, with Let θ m = m and θ n = n both;
步骤13-3:
和
均令H(θ
m,θ
n)=1。
Step 13-3: with Let H (θ m , θ n ) = 1.
计算后,
和
均拥有检测到的Harris角点H。
After calculation, with Each has a detected Harris corner H.
(2)提取兴趣点描述子:(2) Extract the point of interest descriptor:
计算前,
拥有图像密文I
(1),检测到的Harris角点H,
拥有图像密文I
(2),检测到的Harris角点H。
Before calculation, Have image ciphertext I (1) , Harris corner H detected, Have image ciphertext I (2) , Harris corner H detected.
步骤1:
生成一个l
m×l
m×49大小的三维全零矩阵D
(1),
生成一同样大小的三维全零矩阵D
(2),均用来存放兴趣点描述子;
step 1: Generate a three-dimensional all-zeros matrix D (1) of size l m × l m × 49, Generate a three-dimensional all-zero matrix D (2) of the same size, which is used to store the descriptors of points of interest;
步骤2:对于所有的满足H(i,j)=1的i和j,密文形式下计算兴趣点描述子。方法为:Step 2: For all i and j that satisfy H (i, j) = 1, calculate the point of interest descriptor in ciphertext form. The method is:
步骤2-1:
计算
其中FFT()表示快速Fourier变换,LPM()表示log-polar映射,
表示I
(1)中以(i,j)为中心的7×7的像素块;
Step 2-1: Calculation Where FFT () represents a fast Fourier transform, and LPM () represents a log-polar mapping, Represents a 7 × 7 pixel block with (i, j) as the center in I (1) ;
计算
其中
表示I
(2)中以(i,j)为中心的7×7的像素块;
Calculation among them Represents a 7 × 7 pixel block centered at (i, j ) in I (2) ;
步骤2-2:
令D
(1)(i,j,:)=[F
(1)(1,1),…,F
(1)(1,7),…,F
(1)(7,1),…,F
(1)(7,7)];
Step 2-2: Let D (1) (i, j, :) = [F (1) (1,1), ..., F (1) (1,7), ..., F (1) (7,1), ..., F (1) (7,7)];
令D
(2)(i,j,:)=[F
(2)(1,1),…,F
(2)(1,7),…,F
(2)(7,1),…,F
(2)(7,7)]。
Let D (2) (i, j, :) = [F (2) (1,1), ..., F (2) (1,7), ..., F (2) (7,1), ..., F (2) (7,7)].
计算后,
拥有密文形式的兴趣点描述子D
(1),
拥有密文形式的兴趣点描述子D
(2)。
After calculation, Has a point of interest descriptor D (1) in cipher text, The point-of-interest descriptor D (2) in ciphertext form.
(3)兴趣点匹配:(3) Points of interest match:
计算前,
拥有密文形式的兴趣点描述子D
(1),
拥有密文形式的兴趣点描述子D
(2),
和
均拥有控制参数α和β,共享密钥集
Before calculation, Has a point of interest descriptor D (1) in cipher text, Has a point of interest descriptor D (2) in ciphertext, with Both have control parameters α and β, shared key set
步骤1:
生成一个l
D×6大小的矩阵T
(1),其中l
D是D
(1)(i,j,:)≠0的所有(i,j)的个数,
生成一个同样大小的矩阵T
(2),注意D
(1)(i,j,:)≠0的(i,j)一定同时满足D
(2)(i,j,:)≠0;
step 1: Generate a l D × 6 matrix T (1) , where l D is the number of all (i, j) with D (1) (i, j, :) ≠ 0, Generate a matrix T (2) of the same size. Note that (i, j ) with D (1) (i, j, :) ≠ 0 must also satisfy D (2) (i, j, :) ≠ 0;
步骤2:用p表示当前匹配的特征点的索引,
和
均从第一个特征点开始匹配,即令p=1,找到满足D
(1)(i,j,:)≠0的最小的i和对应的j;
Step 2: Use p to represent the index of the currently matched feature points, with Both start from the first feature point, that is, let p = 1, find the smallest i and corresponding j that satisfy D (1) (i, j, :) ≠ 0;
步骤3:密文形式下寻找与(i,j)处描述子最近临的描述子及其位置,方法为:Step 3: In cipher text form, find the descriptor closest to the descriptor at (i, j) and its location. The method is:
步骤3-1:
令T
(1)(p,1)=i,T
(1)(p,2)=j,若存在q<p满足T
(1)(q,3)=i,T
(1)(q,4)=j,则令T
(1)(p,3)=T
(1)(q,1),T
(1)(p,4)=T
(1)(q,2),T
(1)(p,5)=T
(1)(q,5),否则令T
(1)(p,5)=inf;
Step 3-1: Let T (1) (p, 1) = i, T (1) (p, 2) = j, if q <p satisfies T (1) (q, 3) = i, T (1) (q, 4) = j, then let T (1) (p, 3) = T (1) (q, 1), T (1) (p, 4) = T (1) (q, 2), T (1 ) (p, 5) = T (1) (q, 5), otherwise let T (1) (p, 5) = inf;
令T
(2)(p,1)=i,T
(2)(p,2)=j,若存在q<p满足T
(2)(q,3)=i,T
(2)(q,4)=j,则令T
(2)(p,3)=T
(2)(q,1),T
(2)(p,4)=T
(2)(q,2),T
(2)(p,5)=T
(2)(q,5),否则令T
(1)(p,5)=0;
Let T (2) (p, 1) = i, T (2) (p, 2) = j, if q <p satisfies T (2) (q, 3) = i, T (2) (q, 4) = j, then let T (2) (p, 3) = T (2) (q, 1), T (2) (p, 4) = T (2) (q, 2), T (2 ) (p, 5) = T (2) (q, 5), otherwise let T (1) (p, 5) = 0;
步骤3-2:对于任意(i′,j′),如果满足D
(1)(i′,j′,:)≠0&&(i′>i||j′>j)&&((i′-i)
2+(j′-j)
2)>α,密文形式下判断该位置处描述子是否和(i,j)处描述子最近,方法为:
Step 3-2: For any (i ′, j ′), if D (1) (i ′, j ′, :) ≠ 0 && (i ′> i || j ′> j) && ((i′- i) 2 + (j′-j) 2 )> α, to determine whether the descriptor at this position is closest to the descriptor at (i, j) in cipher text, the method is:
步骤3-2-1:
和
交互计算
计算后
拥有
拥有
Step 3-2-1: with Interactive computing After calculation have have
步骤3-2-2:
和
交互计算
计算后
拥有
拥有
Step 3-2-2: with Interactive computing After calculation have have
步骤3-2-3:
和
交互计算
计算后
拥有
拥有
Step 3-2-3: with Interactive computing After calculation have have
步骤3-2-4:
和
交互计算
计算后
拥有
拥有
Step 3-2-4: with Interactive computing After calculation have have
步骤3-2-5:
计算
Step 3-2-5: Calculation
步骤3-2-6:
计算u
(1)=(U
(1)(1)+…+U
(1)(49));
Step 3-2-6: Calculate u (1) = (U (1) (1) + ... + U (1) (49));
计算u
(2)=(U
(2)(1)+…+U
(2)(49));
Calculate u (2) = (U (2) (1) + ... + U (2) (49));
步骤3-2-7:
和
交互计算b=SCP(T
(1)(p,5)-u
(1),T
(2)(p,5)-u
(2)),计算后
和
均拥有b;
Step 3-2-7: with Interactive calculation b = SCP (T (1) (p, 5) -u (1) , T (2) (p, 5) -u (2) ), after calculation with Both have b;
步骤3-2-8:如果b=1,
令T
(1)(p,3)=,T
(1)(p,4)=j′,T
(1)(p,6)=T
(1)(p,5),T
(1)(p,5)=u
(1),
令T
(2)(p,3)=i′,T
(2)(p,4)=j′,T
(2)(p,6)=T
(2)(p,5),T
(2)(p,5)=u
(2)。
Step 3-2-8: If b = 1, Let T (1) (p, 3) =, T (1) (p, 4) = j ', T (1) (p, 6) = T (1) (p, 5), T (1) ( p, 5) = u (1) , Let T (2) (p, 3) = i ', T (2) (p, 4) = j', T (2) (p, 6) = T (2) (p, 5), T (2 ) (p, 5) = u (2) .
步骤3-3:
和
交互计算b=SCP(T
(1)(p,5)×β-T
(1)(p,6),T
(2)(p,5)×β-T
(2)(p,6)),计算后
和
均拥有b;
Step 3-3: with Interactive calculation b = SCP (T (1) (p, 5) × β-T (1) (p, 6), T (2) (p, 5) × β-T (2) (p, 6)) After calculation with Both have b;
步骤3-4:如果b=1,
令T
(1)(p,3)=0,T
(1)(p,4)=0,T
(1)(p,5)=inf,
Step 3-4: If b = 1, Let T (1) (p, 3) = 0, T (1) (p, 4) = 0, T (1) (p, 5) = inf,
令T
(2)(p,3)=0,T
(2)(p,4)=0,T
(2)(p,5)=0。
Let T (2) (p, 3) = 0, T (2) (p, 4) = 0, and T (2) (p, 5) = 0.
步骤4:寻找满足D
(1)(i′,j′,:)≠0&&(i′>i||j′>j)的最小的i′和对应的j′,若存在,
和
均令p=p+1,i=i′,j=j′,返回步骤3重新执行,否则转至步骤5;
Step 4: Find the smallest i ′ and corresponding j ′ that satisfy D (1) (i ′, j ′, :) ≠ 0 && (i ′> i || j ′> j), if they exist, with Let p = p + 1, i = i ′, j = j ′, return to step 3 and execute again, otherwise go to step 5;
步骤5:密文形式下对T
(1)和T
(2)对应的明文T按照T(:,5)的大小重排序,方法为:
Step 5: The plaintext T corresponding to T (1) and T (2) in cipher text form is reordered according to the size of T (:, 5).
步骤5-1:
和
均令i=1;
Step 5-1: with Let i = 1;
步骤5-2:密文形式下求得T(i:l
D,5)的最小值的位置,方法为:
Step 5-2: Find the position of the minimum value of T (i: l D , 5) in ciphertext form, the method is:
步骤5-2-1:
和
均令θ=i;
Step 5-2-1: with Let θ = i;
步骤5-2-2:对于所有的l
D≥i′>i,
和
交互计算b=SCP(T
(1)(θ,5)-T
(1)(i′,5),T
(2)(θ,5)-T
(2)(i′,5)),计算后
和
均拥有b;若b=1,
和
均令θ=i′;
Step 5-2-2: For all l D ≥i ′> i, with Interactive calculation b = SCP (T (1) (θ, 5) -T (1) (i ′, 5), T (2) (θ, 5) -T (2) (i ′, 5)), calculate Rear with Both have b; if b = 1, with Let θ = i ′;
步骤5-3:
交换T
(1)(θ,:)和T
(1)(i,:);
交换T
(2)(θ,:)和T
(2)(i,:);
Step 5-3: Exchange T (1) (θ, :) and T (1) (i, :); Exchange T (2) (θ, :) and T (2) (i, :);
步骤5-4:
和
均令i=i+1,若i≤l
D,返回步骤5-2重新执行,否则转至步骤6;
Step 5-4: with Let i = i + 1, if i ≤ l D , return to step 5-2 and execute again, otherwise go to step 6;
步骤6:对于所有l
D≥i>1,如果(T
(1)(i,1)>T
(1)(i,3)||T
(1)(i,2)>T
(1)(i,4)),则
交互T
(1)(i,1)和T
(1)(i,3),T
(1)(i,2)和T
(1)(i,4);
Step 6: For all l D ≥i> 1, if (T (1) (i, 1)> T (1) (i, 3) || T (1) (i, 2)> T (1) ( i, 4)), then Interacting T (1) (i, 1) and T (1) (i, 3), T (1) (i, 2) and T (1) (i, 4);
如果(T
(2)(i,1)>T
(2)(i,3)||T
(2)(i,2)>T
(2)(i,4)),则
交互T
(2)(i,1)和T
(2)(i,3),T
(2)(i,2)和T
(2)(i,4);
If (T (2) (i, 1)> T (2) (i, 3) || T (2) (i, 2)> T (2) (i, 4)), then Interacting T (2) (i, 1) and T (2) (i, 3), T (2) (i, 2) and T (2) (i, 4);
步骤7:如果存在l
D≥i>j满足T
(1)(i,:)=T
(1)(j,:),则
删去T
(1)(i,:);
Step 7: If l D ≥i> j satisfies T (1) (i,:) = T (1) (j, :), then Delete T (1) (i, :);
如果存在l
D≥i>j满足T
(2)(i,:)=T
(2)(j,:),则
删去T
(2)(i,:)。
If l D ≥i> j satisfies T (2) (i, :) = T (2) (j, :), then Delete T (2) (i, :).
计算后,
拥有密文形式的排序好的p个匹配特征点T
(1),
拥有密文形式的排序好的p个匹配特征点T
(2)。
After calculation, Ranked p matching feature points T (1) in ciphertext form, Ranked p matching feature points T (2) in ciphertext form.
(4)篡改区域定位:(4) Tampering area positioning:
计算前,
p=1,2,拥有密文形式的排序好的匹配特征点T
(1)。
拥有控制参数γ和δ。
Before calculation, p = 1,2, has the sorted matching feature point T (1) in ciphertext form. Have control parameters γ and δ.
步骤1:
生成l
m×l
m大小的全零矩阵E,并令i=1;
step 1: Generate an all-zero matrix E of size l m × l m , and let i = 1;
步骤2:
寻找与T
(1)(i,:)位置满足距离小于γ的点的个数,方法为:
Step 2: Find the number of points that satisfy the distance less than γ from the T (1) (i, :) position by the method:
步骤2-1:
令n=0,j=i+1,集合ε={i};
Step 2-1: Let n = 0, j = i + 1, and set ε = {i};
步骤2-2:
计算a=(T
(1)(i,1)-T
(1)(j,1))
2+(T
(1)(i,2)-T
(1)(j,2))
2,b=(T
(1)(i,3)-T
(1)(j,3))
2+(T
(1)(i,4)-T
(1)(j,4))
2;
Step 2-2: Calculate a = (T (1) (i, 1) -T (1) (j, 1)) 2 + (T (1) (i, 2) -T (1) (j, 2)) 2 , b = (T (1) (i, 3) -T (1) (j, 3)) 2 + (T (1) (i, 4) -T (1) (j, 4)) 2 ;
步骤2-3:若满足a>γ&&b>r/2&&b<2r,则
令n=n+1,ε=ε+{j};
Step 2-3: If a> γ &&b> r / 2 && b <2r is satisfied, then Let n = n + 1, ε = ε + {j};
步骤2-4:令j=j+1,若j≤l
D,返回步骤2-2重新执行,否则转至步骤3;
Step 2-4: Let j = j + 1, if j≤l D , return to step 2-2 and execute again, otherwise go to step 3;
步骤3:若n≥δ,则对于所有的j∈ε
1,
令E(T
(1)(j,1),T
(1)(j,2))=i,E(T
(1)(j,3),T
(1)(j,4))=-i;
Step 3: If n≥δ, then for all j∈ε 1 , Let E (T (1) (j, 1), T (1) (j, 2)) = i, E (T (1) (j, 3), T (1) (j, 4)) =- i;
步骤4:
寻找将所有E(j,k)=i的点(j,k)包含起来的最小圆形,并获得所有位于圆形内部的点(j′,k′),
令E(j′,k′)=i;
Step 4: Find the smallest circle that includes all points (j, k) where E (j, k) = i, and get all points (j ′, k ′) located inside the circle Let E (j ′, k ′) = i;
步骤5:
寻找将所有E(j,k)=-i的点(j,k)包含起来的最小圆形,并获得所有位于圆形内部的点(j′,k′),
令E(j′,k′)=-i;
Step 5: Find the smallest circle that includes all points (j, k) where E (j, k) = -i, and obtain all points (j ′, k ′) located inside the circle Let E (j ′, k ′) =-i;
步骤6:令i=i+1,若i≤5,返回步骤2-3重新执行,否则结束执行;Step 6: Let i = i + 1, if i≤5, return to step 2-3 and execute again, otherwise end execution;
计算后,
p=1,2,拥有疑似篡改区域E。
After calculation, p = 1, 2 and has a suspected tampering area E.
三、用户端
获得检测结果和疑似篡改区域
Third, the client Obtain detection results and suspected tampered areas
计算前,
拥有疑似篡改区域E,拼接的两个区域分布被标注为i和-i,i∈{1,…,5}。
Before calculation, With the suspected tampering area E, the two regions of the stitching are labeled as i and -i, i ∈ {1, ..., 5}.
步骤1:
将E通过安全信道发送给
step 1: Send E over a secure channel to
计算后,
拥有疑似篡改区域E。
After calculation, Possess suspected tampering area E.
在上述步骤中,安全多方乘法协议(Y
(1),Y
(2))=SMP(X
1,X
2)用于计算
的密文矩阵X
1和
的密文矩阵X
2的乘法,且计算过程中
不会得知X
2,
不会得知X
1,
不会得知X
1或X
2,三个服务端均不会得知X
1X
2,协议流程为:
In the above steps, secure multiparty multiplication protocol (Y (1), Y ( 2)) = SMP (X 1, X 2) for calculating Ciphertext matrix X 1 and Multiplication of the ciphertext matrix X 2 and during calculation Will not know X 2 , Will not know X 1 , X 1 or X 2 will not be known, and X 1 X 2 will not be known to all three servers. The protocol flow is:
计算前,
拥有密文矩阵X
1,
拥有密文矩阵X
2,
和
共享密钥集
Before calculation, Has a ciphertext matrix X 1 , Has a ciphertext matrix X 2 , with Shared key set
步骤1:
和
按照预先协商选择和X
1(或是X
2)同样大小的两个密钥矩阵K
1,
step 1: with Select two key matrices K 1 of the same size as X 1 (or X 2 ) according to pre-negotiation,
步骤2:
计算U
1=(X
1+K
2)/K
1,并将U
1发送给
Step 2: Calculate U 1 = (X 1 + K 2 ) / K 1 and send U 1 to
计算U
2=X
2K
1,并将U
2发送给
Calculate U 2 = X 2 K 1 and send U 2 to
步骤3:
随机选择和U
1同样大小的随机数矩阵R,其每个元素均在为0~2
10之间,并计算V=U
1U
2+R;
Step 3: Randomly select a random number matrix R of the same size as U 1 , each element of which is between 0 and 2 10 , and calculate V = U 1 U 2 + R;
步骤4:
将V发送给
将R发送给
Step 4: Send V to Send R to
步骤5:
令Y
(1)=V;
Step 5: Let Y (1) = V;
令Y
(2)=X
2K
2+R;
Let Y (2) = X 2 K 2 + R;
计算后,
拥有密文矩阵Y
(1),
拥有密文矩阵Y
(2),其满足Y
(1)-Y
(2)=X
1X
2。
After calculation, Has a ciphertext matrix Y (1) , Have a ciphertext matrix Y (2) , which satisfies Y (1) -Y (2) = X 1 X 2 .
在上述步骤中,安全多方比较协议b=SCP(X
1,X
2)用于比较
的密文矩阵X
1和
的密文矩阵X
2的大小,且计算过程中
不会得知X
2,
不会得知X
1,
不会得知X
1或X
2,协议流程为:
In the above steps, the secure multiparty comparison protocol b = SCP (X 1 , X 2 ) is used for comparison Ciphertext matrix X 1 and The size of the ciphertext matrix X 2 and the calculation process Will not know X 2 , Will not know X 1 , Will not know X 1 or X 2 , the protocol flow is:
计算前,
拥有密文矩阵X
1,
拥有密文矩阵X
2,
和
共享密钥集
Before calculation, Has a ciphertext matrix X 1 , Has a ciphertext matrix X 2 , with Shared key set
步骤1:
和
按照预先协商选择和X
1(或是X
2)同样大小的两个密钥矩阵K
1,
step 1: with Select two key matrices K 1 of the same size as X 1 (or X 2 ) according to pre-negotiation,
步骤2:
计算U
1=(X
1+K
1)/K
2,并将U
1发送给
Step 2: Calculate U 1 = (X 1 + K 1 ) / K 2 and send U 1 to
计算U
2=(X
2+K
1)/K
2,并将U
2发送给
Calculate U 2 = (X 2 + K 1 ) / K 2 and send U 2 to
步骤3:
计算U
1/U
2,若结果大于1,令b=1,否则令b=0;
Step 3: Calculate U 1 / U 2. If the result is greater than 1, let b = 1, otherwise let b = 0.
步骤4:
将b发送给
和
Step 4: Send b to with
计算后,
和
均拥有比较结果b,其满足若b=1,X
1>X
2,否则X
1≤X
2。
After calculation, with Each has a comparison result b, which satisfies X 1 > X 2 if b = 1, otherwise X 1 ≤ X 2 .
本方案选用的图像加密技术可以用类似技术实现,例如将加运算替换为减运算,以达到同样效果。The image encryption technology used in this solution can be implemented with similar technologies, such as replacing the addition operation with the subtraction operation to achieve the same effect.
本方案选用的基于多方安全计算的乘法协议和比较协议可以选用其他各类多方安全协议实现以达到类似效果,只是计算效率,或使用的云服务端数量发生变化。The multiplication and comparison protocols based on multi-party secure calculations used in this solution can be implemented by using various other multi-party security protocols to achieve similar results, but the computing efficiency or the number of cloud servers used varies.
本方案中的排序算法可以替换为其他任意排序算法以达到同样效果。The sorting algorithm in this solution can be replaced with any other sorting algorithm to achieve the same effect.
现有的图像区域复制取证方法只能在明文下进行,会泄漏图像内容。在本发明方法中,用户端可以将密文形式的图像发送给云服务端,云服务端在不知晓图像内容的前提下,提供有效的区域复制取证服务,实现对篡改操作的检测和定位。相比于传统区域复制取证工具或服务,本发明可以提供用户图像内容的隐私保护。Existing image area copying and forensics methods can only be performed in plain text, which will leak image content. In the method of the present invention, the user terminal can send the image in the form of cipher text to the cloud server. The cloud server provides an effective area copy forensics service without realizing the image content, so as to detect and locate the tampering operation. Compared with the traditional area copying forensics tool or service, the present invention can provide privacy protection of user image content.
本方法适用于图像数字取证云服务,为个人、企业、政府部门等提供安全、可靠的区域复制取证取证服务。该方案适用于不可靠的云服务环境。This method is suitable for image digital forensics cloud services, and provides individuals, enterprises, government departments, etc. with a safe and reliable regional copy forensics and forensics service. This solution is suitable for unreliable cloud service environments.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above embodiment. Any other changes, modifications, substitutions, combinations, and modifications made without departing from the spirit and principle of the present invention, Simplified, all should be equivalent replacement methods, and all are included in the protection scope of the present invention.