From: Walter Roberson on
Randima Hettiarachchi wrote:

> Thanks a lot. But my original challenge was to calculate the hash value
> of a given image as a bit sequence by using a standard encryption
> algorithm like MD5, MD4 or SHA. It is much appreciated if you can
> provide some clues on that.

You mean like the Matlab File Exchange contribution
Compute hash using MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512

by Michael Kleder

?
From: Randima Hettiarachchi on
Walter Roberson <roberson(a)hushmail.com> wrote in message <HexIn.11217$wV.2695(a)newsfe11.iad>...
> Randima Hettiarachchi wrote:
>
> > Thanks a lot. But my original challenge was to calculate the hash value
> > of a given image as a bit sequence by using a standard encryption
> > algorithm like MD5, MD4 or SHA. It is much appreciated if you can
> > provide some clues on that.
>
> You mean like the Matlab File Exchange contribution
> Compute hash using MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512
>
> by Michael Kleder
>
> ?

Exactly. The only problem I experienced with the above mentioned files shared by Michael Kleder is that those were not implemented to accept images as input to the function.

Of course there is no point in feeding pixel values (gray level) one by one as the input to the above encryption algorithms. Because the image hash should be a representative of the whole original image.
From: Walter Roberson on
Randima Hettiarachchi wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <HexIn.11217$wV.2695(a)newsfe11.iad>...
>> Randima Hettiarachchi wrote:
>>
>> > Thanks a lot. But my original challenge was to calculate the hash
>> value > of a given image as a bit sequence by using a standard
>> encryption > algorithm like MD5, MD4 or SHA. It is much appreciated if
>> you can > provide some clues on that.
>>
>> You mean like the Matlab File Exchange contribution
>> Compute hash using MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512
>>
>> by Michael Kleder
>>
>> ?
>
> Exactly. The only problem I experienced with the above mentioned files
> shared by Michael Kleder is that those were not implemented to accept
> images as input to the function.

But that's okay, because I showed you how to convert the image into a
bit stream.
From: Randima Hettiarachchi on
Walter Roberson <roberson(a)hushmail.com> wrote in message <pgyIn.16948$Ak3.5716(a)newsfe16.iad>...
> Randima Hettiarachchi wrote:
> > Walter Roberson <roberson(a)hushmail.com> wrote in message
> > <HexIn.11217$wV.2695(a)newsfe11.iad>...
> >> Randima Hettiarachchi wrote:
> >>
> >> > Thanks a lot. But my original challenge was to calculate the hash
> >> value > of a given image as a bit sequence by using a standard
> >> encryption > algorithm like MD5, MD4 or SHA. It is much appreciated if
> >> you can > provide some clues on that.
> >>
> >> You mean like the Matlab File Exchange contribution
> >> Compute hash using MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512
> >>
> >> by Michael Kleder
> >>
> >> ?
> >
> > Exactly. The only problem I experienced with the above mentioned files
> > shared by Michael Kleder is that those were not implemented to accept
> > images as input to the function.
>
> But that's okay, because I showed you how to convert the image into a
> bit stream.

Sir, do you recommend to feed the image pixel by pixel to the encryption algorithm or just to use the matrix created by using dec2bin() as the image hash?
From: Walter Roberson on
Randima Hettiarachchi wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <pgyIn.16948$Ak3.5716(a)newsfe16.iad>...
>> Randima Hettiarachchi wrote:
>> > Walter Roberson <roberson(a)hushmail.com> wrote in message >
>> <HexIn.11217$wV.2695(a)newsfe11.iad>...
>> >> Randima Hettiarachchi wrote:
>> >>
>> >> > Thanks a lot. But my original challenge was to calculate the hash
>> >> value > of a given image as a bit sequence by using a standard >>
>> encryption > algorithm like MD5, MD4 or SHA. It is much appreciated if
>> >> you can > provide some clues on that.
>> >>
>> >> You mean like the Matlab File Exchange contribution
>> >> Compute hash using MD2, MD5, SHA-1, SHA-256, SHA-384, or SHA-512
>> >>
>> >> by Michael Kleder
>> >>
>> >> ?
>> > > Exactly. The only problem I experienced with the above mentioned
>> files > shared by Michael Kleder is that those were not implemented to
>> accept > images as input to the function.
>>
>> But that's okay, because I showed you how to convert the image into a
>> bit stream.
>
> Sir, do you recommend to feed the image pixel by pixel to the encryption
> algorithm or just to use the matrix created by using dec2bin() as the
> image hash?

If you examine Chris Rodgers' comment
http://www.mathworks.com/matlabcentral/fileexchange/8944-compute-hash-using-md2-md5-sha-1-sha-256-sha-384-or-sha-512

then I think it probable that his update would also be suitable for handling
complete images, with no need to send the image bit-by-bit.

The matrix created by dec2bin() is *not* suitable as the hash itself.