diff --git a/common.pyc b/common.pyc index 27f6487..080bc31 100644 Binary files a/common.pyc and b/common.pyc differ diff --git a/mjpeg/__init__.pyc b/mjpeg/__init__.pyc index 31a8f63..2680e8a 100644 Binary files a/mjpeg/__init__.pyc and b/mjpeg/__init__.pyc differ diff --git a/mjpeg/base.pyc b/mjpeg/base.pyc index 8a478e7..14d629c 100644 Binary files a/mjpeg/base.pyc and b/mjpeg/base.pyc differ diff --git a/mjpeg/dct.pyc b/mjpeg/dct.pyc index 2ef5517..e29441f 100644 Binary files a/mjpeg/dct.pyc and b/mjpeg/dct.pyc differ diff --git a/msteg/__init__.pyc b/msteg/__init__.pyc index 09d526b..6fc0478 100644 Binary files a/msteg/__init__.pyc and b/msteg/__init__.pyc differ diff --git a/msteg/steganalysis/MPB.py b/msteg/steganalysis/MPB.py index 0464b21..f71d1a8 100644 --- a/msteg/steganalysis/MPB.py +++ b/msteg/steganalysis/MPB.py @@ -6,9 +6,10 @@ Yun Q. Shi, et al - A Markov Process Based Approach to Effective Attacking JPEG import time import math import numpy as np -from msteg import * -import mjpeg -from common import * + +from .. import * +from ...mjpeg import Jpeg,colorMap +from ...common import * import csv import json @@ -92,7 +93,7 @@ class MPB(StegBase): :return: TPM - 3-D tensor, numpy array of size (2*T+1, 2*T+1, 4) """ - # return self._get_trans_prob_mat_orig(ciq, T) + return self._get_trans_prob_mat_orig(ciq, T) # timer = Timer() @@ -105,17 +106,17 @@ class MPB(StegBase): Fd = ciq[:-1, :-1] - ciq[1:, 1:] Fm = ciq[:-1, 1:] - ciq[1:, :-1] - Fh1 = Fh[:-1, :-1] - Fh2 = Fh[:-1, 1:] + Fh1 = Fh[:-1, :-1].ravel() + Fh2 = Fh[:-1, 1:].ravel() - Fv1 = Fv[:-1, :-1] - Fv2 = Fv[1:, :-1] + Fv1 = Fv[:-1, :-1].ravel() + Fv2 = Fv[1:, :-1].ravel() - Fd1 = Fd[:-1, :-1] - Fd2 = Fd[1:, 1:] + Fd1 = Fd[:-1, :-1].ravel() + Fd2 = Fd[1:, 1:].ravel() - Fm1 = Fm[:-1, 1:] - Fm2 = Fm[1:, :-1] + Fm1 = Fm[:-1, 1:].ravel() + Fm2 = Fm[1:, :-1].ravel() @@ -127,7 +128,19 @@ class MPB(StegBase): # TPM[Fm1.ravel(), Fm2.ravel(), 3] += 1 # timer.report() - # 1.936746s + # 1.459668s + # timer.mark() + # for i in range(len(Fh1)): + # TPM[Fh1[i], Fh2[i], 0] += 1 + # for i in range(len(Fv1)): + # TPM[Fv1[i], Fv2[i], 1] += 1 + # for i in range(len(Fd1)): + # TPM[Fd1[i], Fd2[i], 2] += 1 + # for i in range(len(Fm1)): + # TPM[Fm1[i], Fm2[i], 3] += 1 + # timer.report() + + # 1.463982s # timer.mark() for m, n in zip(Fh1.ravel(), Fh2.ravel()): TPM[m, n, 0] += 1 diff --git a/msteg/steganalysis/MPB.pyc b/msteg/steganalysis/MPB.pyc index a624d5b..f29a2f7 100644 Binary files a/msteg/steganalysis/MPB.pyc and b/msteg/steganalysis/MPB.pyc differ diff --git a/msteg/steganalysis/__init__.pyc b/msteg/steganalysis/__init__.pyc index 1ddc5fb..961ddc3 100644 Binary files a/msteg/steganalysis/__init__.pyc and b/msteg/steganalysis/__init__.pyc differ diff --git a/msteg/steganography/F3.pyc b/msteg/steganography/F3.pyc index 365bb2c..cf85a0a 100644 Binary files a/msteg/steganography/F3.pyc and b/msteg/steganography/F3.pyc differ diff --git a/msteg/steganography/F4.pyc b/msteg/steganography/F4.pyc index 3921dee..d62f32d 100644 Binary files a/msteg/steganography/F4.pyc and b/msteg/steganography/F4.pyc differ diff --git a/msteg/steganography/F5.pyc b/msteg/steganography/F5.pyc index b9a9728..deef0f0 100644 Binary files a/msteg/steganography/F5.pyc and b/msteg/steganography/F5.pyc differ diff --git a/msteg/steganography/LSB.pyc b/msteg/steganography/LSB.pyc index 4c17fe3..f5ae787 100644 Binary files a/msteg/steganography/LSB.pyc and b/msteg/steganography/LSB.pyc differ diff --git a/msteg/steganography/__init__.pyc b/msteg/steganography/__init__.pyc index 33f0bf3..2e429f0 100644 Binary files a/msteg/steganography/__init__.pyc and b/msteg/steganography/__init__.pyc differ diff --git a/res/extracted b/res/extracted deleted file mode 100644 index c4a89a5..0000000 --- a/res/extracted +++ /dev/null @@ -1,34 +0,0 @@ -this is to be embeded. -//0216 -vim of clang - https://github.com/JBakamovic/yavide -# Usage overview -Category | Shortcut | Description ---------------------------------- | --------------------------------- | --------------------------------- -**Project management** | | - | `n` | Create new project - | `i` | Import project with already existing code base - | `o` | Open project - | `c` | Close project - | `s` | Save project - | `d` | Delete project -**Buffer management** | | - | `` | Close current buffer - | `` | Save current buffer - | `` | Go to next buffer - | `` | Go to previous buffer - | `` | Scroll buffer by one line (down) - | `` | Scroll buffer by one line (up) -**Buffer modes** | | - | `` | Enter the `normal` mode - | `` | Enter the `insert` mode (append after cursor) - | `` | Enter the `insert` mode (insert before cursor) - | `` | Enter the `visual` mode (line mode) - | `` | Enter the `visual` mode (character mode) -**Buffer editing** | | - | `` | Select all - | `` | Cut - | `` | Copy - | `` | Paste - | `` | Undo - | `` | Redo - | `` | Delete the whole line diff --git a/res/extracted.jpg b/res/extracted.jpg new file mode 100644 index 0000000..671a7ea Binary files /dev/null and b/res/extracted.jpg differ diff --git a/res/lena128.png b/res/lena128.png new file mode 100644 index 0000000..0e9b2f0 Binary files /dev/null and b/res/lena128.png differ diff --git a/res/lena64.png b/res/lena64.png new file mode 100644 index 0000000..14f4847 Binary files /dev/null and b/res/lena64.png differ diff --git a/res/lena64gray.jpg b/res/lena64gray.jpg new file mode 100644 index 0000000..671a7ea Binary files /dev/null and b/res/lena64gray.jpg differ diff --git a/res/steged.jpg b/res/steged.jpg index a18b1df..1f96262 100644 Binary files a/res/steged.jpg and b/res/steged.jpg differ diff --git a/res/thulib.jpg b/res/thulib.jpg new file mode 100644 index 0000000..ef0f423 Binary files /dev/null and b/res/thulib.jpg differ diff --git a/res/thulib2.jpg b/res/thulib2.jpg new file mode 100644 index 0000000..1b300bc Binary files /dev/null and b/res/thulib2.jpg differ diff --git a/test_steg.py b/test_steg.py index b118211..098acf4 100644 --- a/test_steg.py +++ b/test_steg.py @@ -27,11 +27,12 @@ txtsample = [116, 104, 105, 115, 32, 105, 115, 32, 116, 111, 32, 98, 101, 32, 10 if __name__ == '__main__': # f3test = F4.F4(sample_key) - f3test = F5.F5(sample_key, 3) - f3test.embed_raw_data("res/test3.jpg", "res/embeded", "res/steged.jpg") + f3test = F5.F5(sample_key, 1) + # f3test.embed_raw_data("res/test3.jpg", "res/embeded", "res/steged.jpg") + f3test.embed_raw_data("res/thulib2.jpg", "res/lena64gray.jpg", "res/steged.jpg") # f3test2 = F4.F4(sample_key) - f3test.extract_raw_data("res/steged.jpg", "res/extracted") + f3test.extract_raw_data("res/steged.jpg", "res/extracted.jpg") print f3test.get_key() pass diff --git a/test_steganal.py b/test_steganal.py index a879ab3..f6b3f45 100644 --- a/test_steganal.py +++ b/test_steganal.py @@ -2,8 +2,8 @@ __author__ = 'chunk' import numpy as np from mjpeg import * -from msteg.steganography import LSB, F3, F4, F5 -from msteg.steganalysis import MPB +from msteg.steganography import LSB, F3, F4, F5 +from msteg.steganalysis import MPB from common import * @@ -29,14 +29,14 @@ if __name__ == '__main__': timer.mark() ima = Jpeg("res/test3.jpg", key=sample_key) - timer.report() # 0.006490s + timer.report() # 0.006490s ciq = ima.coef_arrays[colorMap['Y']] - timer.report() # 0.000019s + timer.report() # 0.000019s mpbSteg = MPB.MPB() - tpm = mpbSteg.get_trans_prob_mat(ciq) - timer.report() # 1.365718s + tpm = mpbSteg._get_trans_prob_mat_orig(ciq) + timer.report() # 1.365718s print tpm, tpm.shape pass -- libgit2 0.21.2