1、MATLAB实现
计算图像哈希值SHA-512,在文献[1]提到的算法如下:文章来源地址https://www.toymoban.com/news/detail-655429.html
% Example Code: Create an MD5 crypto-hash of an arbitrary string, "str"
% Main class of interest: System.Security.Cryptography.HashAlgorithm
% Example String to hash with MD5
% str = 'hello there big world';
% str= ' i love china';
myx=imread('lena.jpg');
% Image_As_A_vector = reshape(typecast(myx, 'uint8'), 1, []));
array_in=char(strjoin(string(reshape(myx,1,[]))));
str=array_in;
% Create any specified cryptographic hasher.
% Supported string args include 'MD5', 'SHA1', 'SHA256', 'SHA384', 'SHA512'.
% That's what I could figure out by random guessing... 'SHA3' didn't work.
% hasher = System.Security.Cryptography.HashAlgorithm.Create('MD5');
hasher = System.Security.Cryptography.HashAlgorithm.Create('SHA512');
% Convert the char
文章来源:https://www.toymoban.com/news/detail-655429.html
到了这里,关于计算图像哈希SHA-512的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!