A list,

Image encryption and decryption based on MATLAB GUI interface relies on orthogonal Latin square scrambling encryption technology.

The basic idea of scrambling encryption can be traced back to the Roman Emperor Julius Caesar’s Design of the Caesar cipher (converting plain text into ciphertext by shifting 26 English letters in a loop) during the Gallic War around 50BC. This letter permutation can be regarded as the value permutation of one-dimensional data stream, which can protect information to a certain extent. After the gradual development of cryptography, multi – table substitution and scrambling and other cryptosystems.

With the rapid development of computer technology, image scrambling encryption technology has become one of the main means of secure image transmission and storage in water. Its basic method is to transform a picture or use mathematical knowledge to scramble pixel position or color, so as to change the original meaningful image information into a “chaotic” image, unable to identify the original image information, so as to achieve the purpose of confusing the third party to a certain extent. To ensure its confidentiality, a key is usually introduced into the algorithm. With the help of the key, the legitimate receiver can decrypt the original image through the inverse transformation of the corresponding algorithm, which is also called decontamination. In addition, most of the present scrambling encryption algorithms are based on mathematical transformation, and sometimes the scrambling process can also be obtained by the periodicity of scrambling encryption.

At present, there are many digital image scrambling encryption methods, these methods have played a positive role in a certain range of applications. Because scrambling encryption is not only used for the security of image information, but also for the basic work of image information hiding, image information preservation and digital watermarking technology, the merits and demerits of scrambling encryption algorithm also directly affect the effect of other processing.

1.1 Image scrambling transformation based on orthogonal Latin square



There are n(n-1) and N (n-1)(n-2) kinds of image scrambling methods, because the orthogonal Latin square contains n-1 orthogonal Latin square. The experimental results show that the preprocessing or post-processing of the image is very effective.

Periodicity of the algorithm:







Like many scrambling algorithms, the periodicity of encryption algorithms based on orthogonal Latin squares remains to be studied.

1.2 Image scrambling transform based on magic square

Magic square is an ancient mathematical problem, which has been recorded in ancient Chinese “Hetu Luo Shu”. It has wonderful characteristics and strange structure, so it has been the attention of ancient and modern scholars at home and abroad.



Magic square is also periodic, and its transformation period is n ^ 2. The biggest difficulty in using magic squares for scrambling transformation is to find magic squares that match the size of the image. In addition, when N is large, the transformation steps to be carried out during image restoration are greatly increased, but the transformation period has a definite rule. After this transformation of image pixels, pixels in the image are disrupted, so as to achieve the purpose of encryption. This transformation is essentially the elementary transformation of the matrix, and since the magic square matrix is a finite dimensional matrix, after n ^ 2 permutations, it will return to its original position.

Ii. Source code

function varargout = ladingfang(varargin)
% LADINGFANG M-file for ladingfang.fig
%      LADINGFANG, by itself, creates a new LADINGFANG or raises the existing
%      singleton*.
%
%      H = LADINGFANG returns the handle to a new LADINGFANG or the handle to
%      the existing singleton*.
%
%      LADINGFANG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in LADINGFANG.M with the given input arguments.
%
%      LADINGFANG('Property'.'Value',...). creates anew LADINGFANG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before ladingfang_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to ladingfang_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help ladingfang

% Last Modified by GUIDE v2. 5 05-Jan- 2005. 22:18:40

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ladingfang_OpeningFcn, ...
                   'gui_OutputFcn',  @ladingfang_OutputFcn, ...
                   'gui_LayoutFcn', [],...'gui_Callback'[]);if nargin & isstr(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a