基本信息
源码名称:LSB随机隐写
源码大小:4.28M
文件格式:.zip
开发语言:MATLAB
更新时间:2020-12-28
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 5 元 
   源码介绍
对BMP位图格式图片的随机隐写以及RS分析


function [ste_cover,len_total] = LSBhide(input,file,output,key)

%读入图像矩阵

cover = imread(input);

ste_cover = cover;

%ste_cover = double(ste_cover);

%将文本转化为二进制序列

f_id = fopen(file,'r');

[msg,len_total] = fread(f_id,'ubit1');

fprintf('隐藏消息长度:%d\n',len_total);

%溢出检测

[m,n] = size(ste_cover);

if len_total > m*n

    error('嵌入信息量过大,请更换图像!');

end

if len_total <= 0

    error('请输入隐藏信息!');

end

p = 1;

[row,col] = randinterval(ste_cover,len_total,key);

for i=1:len_total

    ROW = row(i);

    COL = col(i);

    ste_cover(ROW,COL) = ste_cover(ROW,COL)-mod(ste_cover(ROW,COL),2) msg(p,1);

    if p==len_total

        break;

    end

    p=p 1;

end

%生成信息隐藏后的图像

imwrite(ste_cover,output);

%显示结果

subplot(234);imshow(cover);title('原始图像');

subplot(235);imshow(output);title('随机LSB隐藏后图像');

 

 

 

 

【源码目录】

实验二

├── code
│   ├── 1.bmp
│   ├── 2.bmp
│   ├── Informationtest.m
│   ├── LSBhide.m
│   ├── RSanalysis.m
│   ├── Test.m
│   ├── calF.m
│   ├── compare.m
│   ├── messageless.txt
│   ├── messageless1.txt
│   ├── messagemuch.txt
│   ├── messagemuch1.txt
│   ├── original1.bmp
│   ├── original2.bmp
│   ├── randLSBget.m
│   ├── randinterval.m
│   ├── rgbTogray.m
│   ├── scoverless.bmp
│   ├── scoverless1.bmp
│   ├── scovermuch.bmp
│   ├── scovermuch1.bmp
│   ├── scovermuchtwo.bmp
│   └── test1.m
└── 报告.docx

1 directory, 24 files