




已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
上海电力学院上海电力学院 高级程序设计 高级程序设计 C 课程设计课程设计报告报告 题 目 院 系 计算机科学与技术学院 专业年级 信息安全 2012 级 学生姓名 涂桂花 学号 20123333 指导教师 魏为民 2015 年 4 月 14 日 LSB 信息隐藏实验 目录目录 一 实验目的 1 二 实验内容和步骤 1 1 操作环境 1 2 系统配置 1 3 操作步骤 1 4 程序源代码 5 三 实验结果 5 1 测试图片 5 2 测试结果 5 3 截屏 6 四 实验小结 6 1 遇到的问题总结合分析 6 2 未解决的问题 10 3 实验效果和分析 10 4 总结 10 附件 11 0 上上 海海 电电 力力 学学 院院 实实 验验 报报 告告 课程名称 实验项目 姓名 学号 班级 专业 同组人姓名 指导教师 魏为民魏为民 实验日期 一 实验目的一 实验目的 1 用 MATLAB 函数实现 LSB 信息隐藏和提取 2 了解信息隐藏的作用和实现方法原理 3 学会分析了解隐藏算法 二 实验内容和步骤二 实验内容和步骤 如操作环境 系统配置 操作步骤 程序源代码等 1 操作环境 操作系统 Windows 7 旗舰版 64 位 SP1 DirectX 11 2 系统配置 处理器AMD E1 2100 APU with Radeon HD Graphics 双核 3 操作步骤 1 打开 MATLAB 软件 新建文件夹名为 LSB 2 在 Command Window 窗口里输入 guide 回车 a 如下图所示建立图形界面 将 5 个 push button 控件的 String 属性设置为下图相 信息安全 LSB 信息隐藏实验 涂桂花涂桂花20123333 2012252 信息安全 无2015 4 14 1 应显示的名字 Tag 属性设置为 pbt String 名的格式 将 4 个 axec 控件的 Tag 属性 设置为如下图所显示的名字 3 分别右键点击 5 个 push button 控件 View Callbacks CallBacks 给每个控件添加 Callback 代码 再添加代码之前要为该 fig 文件命名 我在本次实验命名为 LSB3333 fig 各个控件的代码如下 Executes on button press in pbtCover function pbtCover Callback hObject eventdata handles hObject handle to pbtCover see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gCover gCover sFile loadimg if isempty gCover msgbox Cover image is empty Warning warn modal return end 2 axes handles axCover imshow gCover iH iW iL size gCover sMsg sFile num2str iH num2str iW num2str iL set handles text1 String sMsg Executes on button press in pbtSecret function pbtSecret Callback hObject eventdata handles hObject handle to pbtSecret see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gSecret gSecret sFile loadimg if isempty gSecret msgbox Secret image is empty Warning warn modal return end axes handles axSecret imshow gSecret iH iW iL size gSecret sMsg sFile num2str iH num2str iW num2str iL set handles text1 String sMsg set handles text2 String Secret Image Executes on button press in pbtEmbed function pbtEmbed Callback hObject eventdata handles hObject handle to pbtEmbed see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gCover gSecret gStego if isempty gCover msgbox Cover image is empty Warning warn modal return end if isempty gSecret msgbox gSecret image is empty Warning warn modal return end Hc Wc Lc size gCover Hs Ws Ls size gSecret if Hc Hs Wc Ws Lc Ls 3 disp Error Not Match return end gStego uint8 bitor bitand gCover 254 bitshift gSecret 7 imwrite gStego emTmp bmp axes handles axStego imshow gStego Executes on button press in pbtExtract function pbtExtract Callback hObject eventdata handles hObject handle to pbtExtract see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gStego global gCover gSecret if isempty gCover msgbox Cover image is empty Warning warn modal return end if isempty gSecret msgbox gSecret image is empty Warning warn modal return end Hc Wc Lc size gCover Hs Ws Ls size gSecret if Hc Hs Wc Ws Lc Ls disp Error Not Match return end gStego uint8 bitor bitand gCover 254 bitshift gSecret 7 imwrite gStego emTmp bmp axes handles axStego imshow gStego if isempty gStego msgbox Stego image is empty Warning warn modal return end imExtract uint8 bitand 255 bitshift gStego 7 imwrite imExtract exTmp bmp axes handles axExtract imshow imExtract msgbox Extracted Image exTmp bmp Finished 4 Executes on button press in pbtExit function pbtExit Callback hObject eventdata handles hObject handle to pbtExit see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA q questdlg Are you sure to exit figLSB Yes No No if strcmp q No return end delete delete handles figLSB delete LSB3333 4 将测试图片或者图片文件夹放在 LSB 文件夹下 最后点击保存 4 程序源代码 见附件 三 实验结果三 实验结果 1 测试图片 1 隐藏载体图 Leno 图片信息 2 隐藏秘密图 Boy 图片信息 2 测试结果 1 隐藏后的图片信息 2 从隐藏后的图中提取出来的秘密图片信息 5 3 截屏 4 4 实验小结实验小结 1 遇到的问题总结合分析 1 问题 点击退出按键后选择退出 Yes 不能完全退出 解决方法 查看源代码 经过分析 代码没有错 但是没有实现退出该 fig 图形窗体 而是仅仅退出了询问是否退出的 box 的小窗口 经过改正源代码后 可实现完全退出 更改后的代码如下 即将原来的 delete handles figLSB 改为 delete LSB3333 q questdlg Are you sure to exit figLSB Yes No No if strcmp q No return end delete delete handles figLSB delete LSB3333 6 2 问题 老师提供的代码会出现如下图片的一些问题 1 没有选择 Secret Message 图片也能进行信息图片的隐藏和提取 2 没有添加 Cover 图片也能进行信息的隐藏和提取 7 3 没有添加 Cover 和 Secret 图片 不能进行信息隐藏 却能进行信息提取 解决方法 分析老师提供的源代码后 进行改进可解决上述出现的问题 即在没 有选择 Cover 图片或者 Secret 图片的时候 都不能进行信息隐藏和提取 结果截 图如下 8 9 2 未解决的问题 1 问题描述 没有点击 Cover 控件和 Secret 控件选择 Cover 或者 Secret 图片或者不选 择 也能进行隐藏和提取 分析 没有设计代码判断 axec 控件是否有图片内容 2 问题描述 对于不同格式或者不同大小或者灰白和彩色不同的图片不能进行信息图 片的隐藏和提取 分析 本实验代码只能对同种格式且大小相同的图片进行信息图片的隐藏和提取 对于不 同格式大小相同或者格式相同大小不同的图片不能进行隐藏和提取 3 实验效果和分析 1 LSB 算法的抗攻击能力 本实验算法比较简单 抗攻击能力弱 2 随机选择嵌入位 安全性因素的考虑 本实验算法不能随机选择隐藏信息图片的嵌入位 在本程序中设置的为程序默认值 不能提供安全性 可设计随机生成 0 7 的随机数对信息图形的不同位置随机进行嵌入 再增加隐藏和提取的用户口令则会使安全性更好 3 嵌入位均匀分布于载体 每次对图像的一个字节的同一个位嵌入 都是同一个位置 这导致分布不均匀 若实 现随机嵌入图像的不同字节时不同嵌入位可提高嵌入位的均匀分布于载体 4 信息提取的检错 纠错 本实验提取出来的图片和原本要隐藏的信息图片不一样 4 总结 本实验比较简单 在理解了图形信息隐藏的实质和代码的意义后就能很快理解和掌握 不足的是不能将带算法优化已解决遇到的各种问题 将会在以后的学习当中注意知识的积 累和灵活运行 10 附件 源代码 function varargout LSB3333 varargin LSB3333 MATLAB code for LSB3333 fig LSB3333 by itself creates a new LSB3333 or raises the existing singleton H LSB3333 returns the handle to a new LSB3333 or the handle to the existing singleton LSB3333 CALLBACK hObject eventData handles calls the local function named CALLBACK in LSB3333 M with the given input arguments LSB3333 Property Value creates a new LSB3333 or raises the existing singleton Starting from the left property value pairs are applied to the GUI before LSB3333 OpeningFcn gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to LSB3333 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 LSB3333 Last Modified by GUIDE v2 5 14 Apr 2015 10 08 25 Begin initialization code DO NOT EDIT gui Singleton 1 gui State struct gui Name mfilename gui Singleton gui Singleton gui OpeningFcn LSB3333 OpeningFcn gui OutputFcn LSB3333 OutputFcn gui LayoutFcn gui Callback 11 if nargin 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 LSB3333 is made visible function LSB3333 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 LSB3333 see VARARGIN Choose default command line output for LSB3333 handles output hObject Update handles structure guidata hObject handles UIWAIT makes LSB3333 wait for user response see UIRESUME uiwait handles figure1 Outputs from this function are returned to the command line function varargout LSB3333 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 pbtCover function pbtCover Callback hObject eventdata handles hObject handle to pbtCover see GCBO 12 eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gCover gCover sFile loadimg if isempty gCover msgbox Cover image is empty Warning warn modal return end axes handles axCover imshow gCover iH iW iL size gCover sMsg sFile num2str iH num2str iW num2str iL set handles text1 String sMsg Executes on button press in pbtSecret function pbtSecret Callback hObject eventdata handles hObject handle to pbtSecret see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gSecret gSecret sFile loadimg if isempty gSecret msgbox Secret image is empty Warning warn modal return end axes handles axSecret imshow gSecret iH iW iL size gSecret sMsg sFile num2str iH num2str iW num2str iL set handles text1 String sMsg set handles text2 String Secret Image Executes on button press in pbtEmbed function pbtEmbed Callback hObject eventdata handles hObject handle to pbtEmbed see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with handles and user data see GUIDATA global gCover gSecret gStego if isempty gCover msgbox Cover image is empty Warning warn modal return 13 end if isempty gSecret msgbox gSecret image is empty Warning warn modal return end Hc Wc Lc size gCover Hs Ws Ls size gSecret if Hc Hs Wc Ws Lc Ls disp Error Not Match return end gStego uint8 bitor bitand gCover 254 bitshift gSecret 7 imwrite gStego emTmp bmp axes handles axStego imshow gStego Executes on button press in pbtExtract function pbtExtract Callback hObject eventdata handles hObject handle to pbtExtract see GCBO eventdata reserved to be defined in a future version of MATLAB handles structure with
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 化学三模考试题库及答案
- 高职低压电工考试题库及答案
- 2025年中考必背古诗真题及答案
- 2025年工程设计服务项目提案报告
- 2025年度供水供电设备租赁与维护合同范本
- 2025年环保设备销售与污染治理合同
- 2025年驾驶员安全培训试题及答案
- 2025年度演唱会现场执行团队委托合同样本
- 2025年度跨境电商进口商品质量保障协议范本
- 餐饮食品安全试题及答案
- ISO 22000-2018食品质量管理体系-食品链中各类组织的要求(2023-雷泽佳译)
- 卡巴斯基应急响应指南
- 理财规划大赛优秀作品范例(一)
- 2023年四川能投筠连电力招聘笔试参考题库附带答案详解
- 护理管理组织结构与设计
- 静配中心清洁消毒考核试题
- 一级烟草专卖管理师理论考试题库(含答案)
- 小学数学《分数除法》50道应用题包含答案
- 碳捕集、利用与封存技术课件
- 化工试生产总结报告
- 复句与单句的辨析课件
评论
0/150
提交评论