前言
从Jsteg到F5,这一系列算法是因应前面算法的缺点逐步改进的.所以在这里也使用增量的办法进行说明.
基础:DCT系数的特征
- 基本关于0对称分布
- 0系数最多,向两边逐渐减小.
示例:
Jsteg算法
Jsteg是基于DCT的最低位进行隐写的.优点是正常情况下视觉差异几乎难以识别.
规则
Description:
Steg:
- 0/1: Skip
- Adjust to fit the lowest digit (0-even,1-odd) by keeping or x ± 1 x\pm1 x±1
- Remember:2-1 can’t reach to 1, so it has to change to 3.
Extract: - 0/1: Skip
- Just read the lowest digit (0-even,1-odd)
Note: It can be remembered as “|X|” structure.
F3算法
因应
Jsteg出现的值对现象,易被
χ
2
\chi^2
χ2攻击破解.
Like This:
规则
Note:
Shrinkage
means changing the coefficient but not regarding it as an “effective” embed.
Description:
Steg:
- 0:Skip
- Positive and negative parts are SYMMETRICAL.
- 1/-1 and 0: Shrinkage
- Adjust to fit the lowest digit (0-even,1-odd) by keeping or ∣ x ∣ − = 1 |x|-=1 ∣x∣−=1
Remember:
±
1
\pm 1
±1-
0
0
0 CAN reach to 0, so it lead to
∣
x
∣
−
1
|x|-1
∣x∣−1.
Extract:
- 0: Skip
- Just read the lowest digit (0-even,1-odd)
Note: It can be remembered as symmetrical “N” structure.
F4
因应
- F3制造了大量的新增0,这种异常可以用作确定隐写类型.
- 重传导致DCT系数中偶数明显增多(除0外).原始图像一般来说DCT系数中奇数总数多于偶数总数(不包括零),这样很容易区分开原始图像和载密图像.
规则
Steg:
- 0:Skip
- Positive and negative parts are CORRESPONDING.
- 1-0 and -1-1: Shrinkage
- For the positive: odd-1,even-0
- For the negative: odd-0, even-1
- Remember: -1-1->0, so -1-0->-1. And 1-0->0, so 1-1->1
Extract:
- 0:Skip
- For the positive: Read the lowest digit
- For the negative: Read the lowest digit and REVERSE
Note: It can be remembered as corresponding “N” structure.
F5
因应
F4隐写是顺序嵌入的,这就使得LSB的修改集中在图像的某一部分,可能导致图像质量的不均匀;另外,当嵌入信息时,对系数的LSB更改的概率为1/2,所以在嵌入较多信息时,系数的更改会比较多,检测者据此很可能发现秘密信息的存在。
规则
矩阵编码
以k=2为例.
对象:2隐写信息
{
x
i
}
\{x_i\}
{xi}+3非0DCT系数
{
a
j
}
\{a_j\}
{aj}
过程:
- bool p= (if x 1 x_1 x1==lowbit( a 1 ⊕ a 3 a_1\oplus a_3 a1⊕a3))
- bool q= (if x 2 x_2 x2==lowbit( a 2 ⊕ a 3 a_2\oplus a_3 a2⊕a3))
p && q?keep:pass;
!p&&q?Change a1:pass;
p&&!q?Change a2:pass;
!p&&!q?Change a3:pass;
Change means abs(a)-1
In other words, if a non-match occurs in either side, change the exclusive “a” of this side; if both sides are mismatched, change the common one.
To extract:
For each group with 3 DCT coefficient, try to recover:
x
1
=
a
1
⊕
a
3
(1)
x_1=a_1\oplus a_3\tag{1}
x1=a1⊕a3(1)
x
2
=
a
2
⊕
a
3
(2)
x_2=a_2\oplus a_3\tag{2}
x2=a2⊕a3(2)
[Attention] lowbit(Negative XOR Positive)=Reverse(lowbit(Abs(Negative) XOR Positive))
e.g. -1 XOR 1=-1,not 0, and -1 XOR -1=0.
过程
- Select non-0 DCT coefficients and shuffle
- For each 3 DCT coefficients, try to use matrix coding to embed
- [ATTENTION] Shrikage in this process: if any DCT coefficient bacame 0 after coding, cancel the embedding this time and load 3 DCT coefficients and restart.
e.g.
30 20 1->30 20 0(x)
Then
30 20 13(the next non-0 DCT coefficient)->30 20 12
or 30 1 20->30 0 20
Then
30 20 13->30 19 13 - Then Try to write in.
F5隐写后,图像的DCT系数直方图特性依然得到了保持.时间效率较高因为改动位数少.但是空间效率降低.
重要参考: https://fennudehaogua.top/2019/03/21/Steganography-basic/