Should all implementations of SHA512 give the same Hash?
By : user3194644
Date : March 29 2020, 07:55 AM
it helps some times Yes, that's one of the basic building block of PKI: the same data block passed to a hash should always return the same hash value. beware of the interpretation, though: the result of a SHA-2(512) hash is a block of 512 bits, not a string value so it will first be encoded for human consumption and it is therefore possible that you see what looks like visually different results when it's simply a matter of using different encodings.
|
Do hash functions contradict the founding assumptions of Evolutionary Algorithms?
By : booltrue
Date : March 29 2020, 07:55 AM
it should still fix some issue Yes, it's pretty much impossible to construct a fitness function that consistently tells you that value A is closer to the goal than value B based on the output of a (good) cryptographic hash function for all three. That follows from the property you mentioned. So evolutionary algorithms can't speed up reversing cryptographic hash functions for the average case. However, this shouldn't be a surprise: Said property is only useful in the first place because it breaks precisely the approach of evolutionary algorithms (speeding up reversal by looking at hash value similarity). Generalizing this, evolutionary algorithms (like all other algorithms that rely on a heuristic to guide their search, e.g. A*) are only useful if you can define a meaningful fitness function (heuristic)†. Obviously, it is possible to construct problems that don't allow this (e.g. by giving too little information), and it's completely propably that there are some more real-world applications that have the same problem. Evolutionary algorithms don't cure cancer, but again that's no surprise (nothing does, else we'd have moved to a different metaphor).
|
Which implementations of the C programming language violate the following assumptions?
By : user3273476
Date : March 29 2020, 07:55 AM
around this issue Alignment is not addressed by C99. It does not support any of your assumptions. Implementations are allowed free reign to insert padding -- or not -- in struct representations between members and/or at the end, however they see fit. The standard gives implementations enough freedom to serve the alignment requirements of their target environments, but it provides no basis to support any behavior intended to probe alignment requirements. In particular, their is no inherent relationship between the offset of a struct member and the optimal alignment of objects of its type. Although your code probably does correctly determine alignment when used with many implementations, under many conditions, that code, or anything based on the same concept, would surely fail when compiled in a mode that caused all struct representations to be packed without padding. Such a mode is provided as an option by many compilers and could in principle be the default mode for some compilers.
|
Different results from Hash.each and Hash.inject implementations
By : Vincent Sanchez-Gome
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further It's because the if will return nil in case the condition is not satisfied, and that will be used for the value of matches in the next iteration. Use Enumerable#each_with_object instead: code :
@entries.each_with_object({}) do |(entry, definition), matches|
matches.merge!({entry => definition}) if entry.match(/^#{entry_to_find}/)
end
|
Are C++ std::hash implementations always deterministic?
By : Thanos
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , No, and documentation clearly says that:
|