0
点赞
收藏
分享

微信扫一扫

【图像加密】基于LSB算法实现图像隐写含Matlab源码

1 简介

随着多媒体技术的快速发展,信息安全变得越来越重要,如何保证信息不被窃取和篡改,已成为近年来信息安全领域的研究热点.介绍了信息隐藏技术的概念和发展,分析了最常用的LSB隐写算法原理,并且用MATLAB软件成功地实现了该隐写算法.最后指出了隐写术的发展趋势.

使用数学方程对 LSB 隐写算法进行抽象和建 模 。 LSB 隐写算法既可以对图像中的像素做出 ±1 的改动, 也可以不做任何改动, 这依赖于待隐藏信息的特性和相应像素的 LSB 值。

【图像加密】基于LSB算法实现图像隐写含Matlab源码_ide

【图像加密】基于LSB算法实现图像隐写含Matlab源码_ide_02

【图像加密】基于LSB算法实现图像隐写含Matlab源码_ide_03

2 部分代码

function varargout = LSB(varargin)
% LSB MATLAB code for LSB.fig
% LSB, by itself, creates a new LSB or raises the existing
% singleton*.
%
% H = LSB returns the handle to a new LSB or the handle to
% the existing singleton*.
%
% LSB('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in LSB.M with the given input arguments.
%
% LSB('Property','Value',...) creates a new LSB or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before LSB_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to LSB_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 LSB
% Last Modified by GUIDE v2.5 22-Apr-2021 13:43:30
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @LSB_OpeningFcn, ...
'gui_OutputFcn', @LSB_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before LSB is made visible.
function LSB_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to LSB (see VARARGIN)
% Choose default command line output for LSB
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes LSB wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = LSB_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename,filepath]=uigetfile('.bmp','选择原始bmp图片文件');
if(filename==0)
return;
end
global originalfile x
originalfile= strcat(filepath,filename);
x=imread(originalfile);
subplot(handles.axes1);
imshow(originalfile);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename,filepath]=uigetfile('.bmp','选择嵌入隐秘文件');
if(filename==0)
return;
end
global secretfile y
secretfile= strcat(filepath,filename);
y=imread(secretfile);
subplot(handles.axes2);
imshow(secretfile);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

3 仿真结果

【图像加密】基于LSB算法实现图像隐写含Matlab源码_信息安全_04

4 参考文献

[1]李友, 张定会, 许赛赛,等. 基于图像的LSB隐写算法的实现[J]. 计算机安全, 2010(7):3.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

【图像加密】基于LSB算法实现图像隐写含Matlab源码_信息隐藏_05


举报

相关推荐

0 条评论