简体   繁体   中英

Threshold function generating for Image Steganography

I'm working on a project in C# by implementing a research paper .Now I'm having problems and I sent a mail with this image to both writer but no one is replying

在此处输入图片说明

Any Suggestion of digest algorithm to calculate threshold?

and also having difficult in understanding mapping function of research paper.

Research paper 2 and I think both are same with just a little bit of changing..

That's an unfortunate situation you're in. Both papers lack clarity and all the relevant information to fully replicate the process. The older paper even admits that (Section 4, Step IX).

Regardless, there is some clarification and detective work we can do ourselves.

  • T is calculated before C .
  • There is no ambiguity about calculating C using T .

The C in the Threshold algorithm is most likely a typo of Ch . In the more recent paper, Step 1 in Section II, says that the threshold calculation depends on the number of characters in the message. Additionally, in the older paper, they assign the number of characters to C . Considering the amount of replication between the two papers, it wouldn't be surprising if they forgot to change C to Ch . Unfortunately, they don't provide the algorithm for calculating the factor (threshold in the paper of interest), but we can assume they had at least written it down somewhere unpublished, which they copied for the new paper to describe the threshold algorithm.

When it comes to X , you're out of luck. I found no other reference of it anywhere in the paper and all the inputs for the threshold function are accounted for (Ch: total number of characters, PL: password, PM: passkey). This leads me to speculate... what if... X is a typo of C , since they are next to each other on the keyboard? This would also be consistent with the algorithm returning values no greater than 9. Other than suspecting that with all the mod 9 operations litterred throughout, the old paper explicitly says so (Section 4, Step IX):

Generally factor value lies within the range 2 to 9 because practical experiment shows that above this value, the time taken by the block mapping function is too much and output values goes beyond the range.

Overall, I speculate the correct algorithm is something like:

T = Ch % 9
T = T + PL
T = T % 9
T = T + [(9-Ch)((PL-PM)/PL)

However, there is one final point. (PL-PM)/PL can return a floating number. If you use integer division or the floor function (both equivalent), the algorithm is almost consistent with giving values between 2 and 9. In fact, I get values between 0 and 8 but you can shift them by one to get the range 1-9.

If all else fails, may I recommend you just randomly generate a value of T within its acceptable bounds? As long as the generation of that value does not create any internal inconsistency of the algorithm, ie, T must be calculated as described in the paper or else some later step won't function properly, you should be fine.


Regarding the mapping function for Bi , Equation 7 makes it absolutely clear what the function is. The inconsistencies with the form described in step 10 of the example (p. 47) stem from typos and redefining variables halfway through the paper. To be explicit, F is a typo of T and u is the same as C , which is the size of unit. For some silly reason (probably because it was defined as such in the old paper), they used u instead of C in step 3 of the example. And it is T to the power of i times C to the power of i, or Math.Pow(T,i) * Math.Pow(C,i) .

If I may express my opinion at this point, the way they define the mapping function is not convincing to me. They say the traits of the function must be that the numbers generated must be between 1 and B, where B in the number of blocks you have in the image after height and width segmentation. They also say that a collision must not occur or you will end up embedding to the same block twice and therefore overwriting previously hidden information. Those traits are legit and necessary, but their implementation and argument of what works best is just questionable. No need to reinvent the wheel, especially for random number generating functions, since you can't guarantee thorough investigation that it does satisfy your requirements.

I would simply go with generating a list of numbers 1, 2, 3, ..., B and then shuffle it. It guarantees no number exceeding the limit, there will be no collision and you also guarantee a well randomised order. The most popular shuffling algorithm for that is the Fisher-Yates. Here is an implementation in C#. To ensure both the embedding and extraction processes generate the same randomised order, you can initialise the PRNG with the same seed, which in this case can be the password shared between both parties. Since the seed must been an integer and the password is string, just hash it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM