散列虚拟文件是明智的还是可行的或安全的? [英] Is it advisable or practical or safe to hash a dummy file?

查看:69
本文介绍了散列虚拟文件是明智的还是可行的或安全的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我设计了自己的哈希计算器原型.我需要拿出不同大小的文件类型,例如. 100KB,10MB,100MB,1GB等以测试原型.因此,我使用Dummy File Creator创建了这些大小的虚拟文件.我测试了散列真实文件和散列具有相同文件大小的虚拟文件,例如1GB.但是结果有些显着地不同,即哈希一个真实的1GB文件所花费的时间与哈希1GB的虚拟文件所花费的时间是与众不同/相异.因此,只想知道您的想法和建议,对虚拟文件进行哈希处理是明智的,可行的还是安全的?还是我的原型面临错误?
谢谢.感谢您的时间.

问候,
Giggsey

Hi All.
I have designed my own hash calculator prototype. I need to come up with file type of different sizes eg. 100KB, 10MB, 100MB, 1GB, etc in order to test the prototype. So, I created the dummy files for these sizes using Dummy File Creator. I tested hashing the real file and hashing the dummy file of the same file size e.g. 1GB. But the results are strikingly different somewhat i.e. the time taken to hash a real 1GB file is so distinct/dissimilar from the time taken to hash a 1GB dummy file. So, just wanna know your thoughts and advice, is it advisable or practical or safe to hash a dummy file? Or, am I facing a bug in my prototype?
Thanks. Appreciate your time.

Regards,
Giggsey

推荐答案

首先,没有理由对虚拟文件进行散列是不安全的,也不是出于测试目的不切实际的.

至于时间上的差异,很难说.如果哈希算法改变了它基于文件内容的行为(例如,如果块的最后一位是0,则执行A,如果它是1,则执行B,或者这样做).仅满足这些条件中最快的一个,然后您会希望看到它.真实文件也可以分段,而伪文件则不可以.您还必须考虑正在运行的其他程序,正在运行的计算机(我假设您在同一台计算机上进行了测试,但也许您没有在这台计算机上进行测试),以及任何其他因素.没有更多细节(例如,您正在使用哪种哈希算法),很难确定.
First, there''s no reason hashing a dummy file would be unsafe, nor would it be impractical for testing purposes.

As for the difference in time, it''s hard to say. If the hashing algorithm changes it''s behavior based on the contents of the file (e.g. if the last bit of a block is 0 do A, if it''s 1 do B, or something to that effect) and the dummy file only meets the fastest of those conditions, then you''d expect to see it. The real file could also be fragmented, while the dummy file is not. You also have to account for other programs running, the machine it''s running on (I assume you tested on the same machine, but maybe you didn''t), and any other number of factors. Without more details (for example, what hashing algorithm you''re using) it''s hard to be sure.


这篇关于散列虚拟文件是明智的还是可行的或安全的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆