资源简介
田军的《基于差分的可逆水印》的程序实现,整幅图片嵌入hash值,最后无损还原。附带PSNR分析

代码片段和文件信息
function h = hash(inpmeth)
% HASH - Convert an input variable into a message digest using any of
% several common hash algorithms
%
% USAGE: h = hash(inp‘meth‘)
%
% inp = input variable of any of the following classes:
% char uint8 logical double single int8 uint8
% int16 uint16 int32 uint32 int64 uint64
% h = hash digest output in hexadecimal notation
% meth = hash algorithm which is one of the following:
% MD2 MD5 SHA-1 SHA-256 SHA-384 or SHA-512
%
% NOTES: (1) If the input is a string or uint8 variable it is hashed
% as usual for a byte stream. Other classes are converted into
% their byte-stream values. In other words the hash of the
% following will be identical:
% ‘abc‘
% uint8(‘abc‘)
% char([97 98 99])
% The hash of the follwing will be different from the above
% because class “double“ uses eight byte elements:
% double(‘abc‘)
% [97 98 99]
% You can avoid this issue by making sure that your inputs
% are strings or uint8 arrays.
% (2) The name of the hash algorithm may be specified in lowercase
% and/or without the hyphen if desired. For example
% h=hash(‘my text to hash‘‘sha256‘);
% (3) Carefully tested but no warranty. Use at your own risk.
% (4) Michael Kleder Nov 2005
%
% EXAMPLE:
%
% algs={‘MD2‘‘MD5‘‘SHA-1‘‘SHA-256‘‘SHA-384‘‘SHA-512‘};
% for n=1:6
% h=hash(‘my sample text‘algs{n});
% disp([algs{n} ‘ (‘ num2str(length(h)*4) ‘ bits):‘])
% disp(h)
% end
inp=inp(:);
% convert strings and logicals into uint8 format
if ischar(inp) || islogical(inp)
inp=uint8(inp);
else % convert everything else into uint8 format without loss of data
inp=typecast(inp‘uint8‘);
end
% verify hash method with some syntactical forgiveness:
meth=upper(meth);
switch meth
case ‘SHA1‘
meth=‘SHA-1‘;
case ‘SHA256‘
meth=‘SHA-256‘;
case ‘SHA384‘
meth=‘SHA-384‘;
case ‘SHA512‘
meth=‘SHA-512‘;
otherwise
end
algs={‘MD2‘‘MD5‘‘SHA-1‘‘SHA-256‘‘SHA-384‘‘SHA-512‘};
if isempty(strmatch(methalgs‘exact‘))
error([‘Hash algorithm must be ‘ ...
‘MD2 MD5 SHA-1 SHA-256 SHA-384 or SHA-512‘]);
end
% create hash
x=java.security.MessageDigest.getInstance(meth);
x.update(inp);
h=typecast(x.digest‘uint8‘);
h=dec2hex(h)‘;
if(size(h1))==1 % remote possibility: all hash bytes < 128 so pad:
h=[repmat(‘0‘[1 size(h2)]);h];
end
h=lower(h(:)‘);
clear x
return
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 527280 2009-03-19 23:41 基于差分的可逆水印\dmrc_difference_expansion.pdf
文件 2814 2009-04-23 20:53 基于差分的可逆水印\hash.m
文件 66616 2009-03-20 10:30 基于差分的可逆水印\lena.bmp
文件 466 2009-04-23 20:37 基于差分的可逆水印\psnr.m
文件 6291 2009-04-24 14:57 基于差分的可逆水印\Resersible_watermarking.m
文件 2228924 2009-03-19 23:36 基于差分的可逆水印\revwm.pdf
文件 3571 2009-04-22 20:21 基于差分的可逆水印\Rlecode.m
文件 805 2009-04-16 20:51 基于差分的可逆水印\Rlerecode.m
文件 281088 2009-04-25 18:47 基于差分的可逆水印\程序文档.doc
目录 0 2009-04-25 18:48 基于差分的可逆水印
----------- --------- ---------- ----- ----
3117855 10
相关资源
- 如何在 Altium Designer 中快速进行差分对
- 背景差分法 多目标跟踪
- 差分形式的阻滞增长模型
- 简析用电阻设定增益的单端至差分转
- 正交WALSH码的相关延迟-调频-差分混沌
- 台湾交大LNA宽带放大器差分吉尔伯特
- 背景差分法检测
- 对称分组加密及线性攻击与差分攻击
- GPS-RTK在山区开采沉陷中的应用研究
- “非良导体热导率的测量”大学
- NOIP必学内容之前缀和与差分颜鸿宇
- 差分隐私早期学习笔记__含差分隐私
- 论文研究-差分隐私模型的启发式隐私
- U-blox公司NEO-M8P-2差分定位配置
- (博士论文)多目标动态差分进化算
- 线性统计模型 线性回归与方差分析
- 波动方程时域有限差分地震正演建模
- 常微分方程的有限差分方法及其简单
- 差分GPS及GPS现代化
- 时间差分法帧间差分法opencv和vc代码实
- 变网格步长声波方程有限差分数值模
- 基于opencv2.4.3、VS2010的背景差分法目标
- 参数自适应的最先进的差分进化算法
- 波动方程有限差分模拟
- 差分方程的相容性、收敛性和稳定性
- 一种求解带时间窗车辆路径问题的混
- GPSGLONASSCOMPASS联合伪距差分定位
- 基于二阶差分的加权最小费用流相位
- Differential Evolution_A Practical Approach to
- matleb有限差分法仿真电场
评论
共有 条评论