Share
Explore BrainMass

Hashing

Hashing is a way to map 'keys' (data of any type) to slots in a table of a set length. The key is put through a hash function to return a value, known as the hash valuehash code, hash sum, checksum or simply hash which is what is actually stored, instead of the data itself. The nature of a secure hashing function should be such that it is near impossible to work backwards from the hash value to find the original data value - this makes hashing ideal for storing passwords without storing the actual plaintext password. Another common use is shortening data since the output of a hash function must is of a fixed length. Cryptography also makes use of hashing as it's difficult to fake a hash value in order to hide malicious data. That is the whole idea behind the Pretty Good Privacy data validation algorithm. There are many other uses of hashing in real-world computer science too, so it is an important area to understand.

In a hash table, the has function outputs are stored associatively. This means the rows can be searched in constant time, and then that row's value used as a reference to point back to the key that holds the information you actually need. Since following the reference is also doable in constant time, this makes for a much faster search than iterating through a list, or many types of tree. A good hash function is referentially transparent. An obstacle to this fast searching is if two data values hash to the same slot in the hash table - called a collision. To deal with this, many programming languages have a way to override hash functions for an object.

In any deterministic hasing function, there will be a set of keys that hashes to the same slot, causing collisions that degrade the usefulness of the table. To avoid this, one can use universal hashing which is when you select a hashing function from a family of such functions at random each time. Individually, they have the same limits as a deterministic function, but when picked at random from their family, you can evade most collisions and deny any attackers hoping to use that feature of a poorly-designed hashing table against you.

Java Hashtables

We are working on hashtables and I am trying to figure out a real life example that could be solved with hashtables to jtree as well as some type of array or jlist. I just need some opinions or examples of this part please. Here is an exercise I do not understand in this chapter. Observe the following code, which create

Email and Key Encryption

P18. Suppose Alice wants to send an e-mail to Bob. Bob has a public-private key pair, and Alice has Bob's certificate. But Alice does not have a public, private key pair. Alice and Bob (and the entire world) share the same hash function. a. In this situation, is it possible to design a scheme so that Bob can verify that Alice

Excel 2003 Multiple Choice Questions

1. Cell E23 has a date value and you wish to place that date on an invoice prefaced with the text located in B15. What is the command to do that? (This question is from Chapter 6.) a. =B15&E23 b. =proper(B15)&" "&text(E23,"mmmm dd, yyyy") c. B15&" "&E23 d. =join(B15&E23) e. =proper(B15)&" "&proper(E23) 2. To