我可以根据初始密钥和输出哈希来识别哈希算法吗? [英] Can I identify a hash algorithm based on the initial key and output hash?
问题描述
如果我同时创建了初始密钥和哈希,是否有任何方法可以确定使用了哈希算法?
例如:
>- 键:更高
- 哈希:df072c8afcf2385b8d34aab3362020d0 >
- Key: higher
- Hash: df072c8afcf2385b8d34aab3362020d0
- Algorithm: ?
好吧,考虑到有限数量的流行哈希算法,也许你提出的并不是那么荒谬。
但是,假设我问过你这个问题:
如果我有一个输入和一个输出,
可以确定函数吗?
blockquote>
通常来说,, no,您无法简单地通过了解一个输入和一个输出来确定任何函数的内部运作 ,没有任何额外的信息。
//非常非常基本的插图
if(unknownFunction(2)== 4 ){
/ /未知函数做什么?
//返回x + 2?
//或者返回x * 2?
//或者返回Math.Pow(x,2)?
//或返回Math.Pow(x,3) - 4?
//等等
}
If I have both the initial key and the hash that was created, is there any way to determine what hashing algorithm was used?
For example:
解决方案Well, given that there are a finite number of popular hash algorithms, maybe what you propose is not so ridiculous.
But suppose I asked you this:
If I have an input and an output, can I determine the function?
Generally speaking, no, you cannot determine the inner-workings of any function simply from knowing one input and one output, without any additional information.
// very, very basic illustration if (unknownFunction(2) == 4) { // what does unknownFunction do? // return x + 2? // or return x * 2? // or return Math.Pow(x, 2)? // or return Math.Pow(x, 3) - 4? // etc. }
这篇关于我可以根据初始密钥和输出哈希来识别哈希算法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!