This article was originally published in Sina blog http://blog.sina.com.cn/s/blog_b27f71160101h5gi.html, Sina Blog will be moved to CSDN, the original Sina blog stop updating.
① after applying for move, delay to receive the code to move
② a little bit more familiar with the algorithm
③ Contact Keyboard Typing
Based on the three points above, the blog post is knocked over again.
Logistic chaotic scrambling encryption:
here again according to Logistic chaos makes another kind of scrambling: position scrambling.
What is positional scrambling, as the name implies, is to move the position of one pixel in the image to another point of destination. We know that the goal point is of course the more random the better. This process, the gray values of all pixels have not changed, but the position of the scrambling, so its histogram will not change. Let's do the position scrambling.
As mentioned above: logistic chaotic sequence encryption of image processingIf a pictureM*nsize of the picture that weLogisticiterate.M*ntimes, getM*na(0,1)sequence of floating-point numbers betweenA), set the sequenceAmultiply each element in theM*n, that is to sayAextended to the(0,m*n)floating-point number, and then we take an integer to get(0,m*n)sequence of integers betweenB, OK, looks like a lot of work is done, the following can be encrypted.
We're going to use this sequence to generate random coordinates (that is, the destination point), so b b (i) (i=1,2,..., m*n) f (x, y) ( x: line y: column):
column coordinates: y=b (i)/n;
line coordinates: x=b (i)%N;
in this way, we get the M*n A random coordinate point, the truth. The grayscale value of the first point in the image to be encrypted is moved to the first random coordinate, and once and the other, when all the grayscale is moving, the scrambling ends, and then the scrambling encryption is completed.
If you read this article carefully and think about it, you will feel that there is a problem : according to the principle that this(0,m*n)values are definitely not duplicated, but due to computer precision and type conversion , so there must be duplicate values, that is, random coordinate points exist duplicate!!! This must not be possible, so how to avoid it? We generally deal with this: in the iterative process, each iteration, the generation of a random coordinate point, to determine whether the coordinate point has not been occupied, if not a occupy flag, if it has been occupied, then discard the point to continue the iteration, until you find a non-occupied coordinate point, so continue until you find M*n A non-repeating coordinate point.
Of course, we also need to pay attention to coordinate boundary problems.
There is no code here, let's write it for ourselves.
After encryption before encrypting
Logistic chaotic scrambling encryption of image processing