信息隐藏教程自带函数运行出错哎!!!!
matlab程序hashreplacement出现错误,请各位高手帮忙!
说明: md5dll.dll跟该程序位于同个目录下.
function[row,col,j] = hashreplacement(matrix,quantity,key1,key2,key3)
% 记录载体矩阵大小
[X,Y] = size(matrix);
% 初始化 row 和 col
row = zeros([1,quantity]);
col = zeros([1,quantity]);
j = zeros([1,quantity]);
for i = 1:quantity
v = round(i/X);
u = mod(i,X);
v = mod(v+md52num(md5(u+key1)),Y);
u = mod(u+md52num(md5(v+key2)),X);
v = mod(v+md52num(md5(u+key3)),Y);
j(i) = v*X+u+1;
col(i) = mod(j(i),Y);
row(i) = j(i)/Y;
row(i) = double(uint8(row(i)))+1;
if col(i) == 0
col(i) = Y;
row(i) = row(i)-1;
end
end
% hashreplacement 的子函数用以将MD5码转成数字
function result = md52num(md5code)
result = 0;
for i = 1:32
result = result + table(md5code(i))*i;
end
% hashreplacement 的子函数用以查表转换16进制字符为数字
function a=table(character);
switch character
case '0',a=0; case '1',a=1; case '2',a=2; case '3',a=3; case '4',a=4;
case '5',a=5; case '6',a=6; case '7',a=7; case '8',a=8; case '9',a=9;
case 'a',a=10; case 'b',a=11; case 'c',a=12; case 'd',a=13;case 'e',a=14; otherwise a=15;
end
function y=md5(M)
y=md5dll(M);
Error in ==> F:\毕业设计\md5dLL.dll
Error in ==> F:\毕业设计\hashreplacement.m (md5)
md5dll.dll 不是有效的win32应用程序,这个错误是怎么回事呢,网上没搜到解决方法
------解决方案--------------------------------------------------------
检查一下,看连接的CRT版本是否一致。