Will I be able to hash a DICOM image?

5 ビュー (過去 30 日間)
Darsana P M
Darsana P M 2018 年 2 月 28 日
コメント済み: Darsana P M 2018 年 3 月 8 日
I have a DICOM image as input. I would like to hash the dicom image using any hash algorithm? Will I be able to perform hash using SHA-1 algorithm? If so, can somebody help me with the matlab code?

回答 (2 件)

Walter Roberson
Walter Roberson 2018 年 2 月 28 日
Yes, you can hash any data that can be represented in binary. At worst, use typecast on the numeric array to convert to uint8 and hash that.
If I recall correctly sha is available in the file exchange
  25 件のコメント
Jan
Jan 2018 年 3 月 8 日
@Dorsana: The question is still not clear to me, even after 23 comments. You could call DataHash with the option: 'Input', 'array'. But then the "hash over the header" is something very specific, which can be reproduced with DataHash only. Maybe it would be much better to get the "Dicom header" as byte stream and calculate the hash over this. This would be reproducible without Matlab also, while applying DataHash to the imported header information is very specific. The hash would e.g. change if Mathworks decides to use string objects instead of char vectors in the future.
In consequence I cannot suggest a specific method to solve your problem reliably, but I have the impression, that the problem is not defined exactly yet.
Darsana P M
Darsana P M 2018 年 3 月 8 日
Sir, I have to give dicom image as input to an algorithm AES-GCM. This algorithm has the following
inputs: plaintext,key,initialization vector.
outputs: ciphertext,tag
Thus, the process to be done is to take header part alone of dicom image and hash it (using MD5 or SHA). This will gave key and initialization vector. Then image part alone of dicom image will give the plaintext.
Thus, I need to get the dicom header and pixel data separately. Ths is the problem? What must be done?

サインインしてコメントする。


Jan
Jan 2018 年 3 月 5 日

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by