Tinker, maybe it is not obvious to you but a system like that doesn’t even begin to cut it IRL (although it would work for your kids to play with).
Bill H, you obviously know the stuff too. It just seems we are focusing on different things. You are focusing on the OPs narrower issue of authentication while I am talking about the much broader field of encryption which is where the thread seems to have gone. I guess it’s OK as long as we all know exactly what we are referring to.
Yes, you can use hash functions for authentication as they are also used in digital signatures. In both cases you are not getting the original message by the relatively safe assurance that the original password or signature is there and was used to generate the hash.
>> I have never heard the term “one-way” in cryptography used to refer to encryption. All encryption is designed to be two way, i.e. decryptable. The term “one-way” is used commonly to describe a hash.
Well, we can agree on any terminology you like and it’s fine with me as long as we both use the same meanings but to me a one way function is not necessarily a hash function. A one way function is one that is easy one way and difficult or impossible to reverse. In an earlier post I gave an example with mod math. This type of one way function is used in asymetrical cryptography and there is NO loss of information when encrypting. I have seen this type of function called a “one way” function in books.
Yes asymmetrical encryption has a way out but it is not the way you came in. The way is is “one way” and the way out is also “one way”. So I would refer to asymmetrical encryption as one way because I can give you the cyphertext and the key I used to encrypt it, and you can still not get the cleartext. You need the private key for that.
Asymmetrical encryption would be something like this: Imagine a shute from your office to the ground floor. everybody in the office has a key to open this shute door so they can put their messages there but once in there they are gone. There’s no way to recover them even if you have that key.
At the ground floor there is one person who has a key to the door to the shute there. Only he can get those messages as the key he has and the key to the upstairs door are different.
A hash function is a different thing altogether. It is even more “one way” but there is loss if information. Hash functions can be used for authentication but not for encryption. You obviously understand all this well and it is just a matter of terminology.
Part of the problem here is that you are still talking about the OP password thing when the thread has generally moved to the broader field of encryption.
So to clarify for those who are a little behind:
Symmetrical encryption uses the same key to encrypt and decrypt. The key must be shared by both parties (Alice and Bob) and kept secret from the rest of the world. Until 1976 the only way to distribute keys was by sharing them and the logistics were getting out of hand.
Asymmetrical encryption uses a public key to encrypt and a private key to decrypt and so there is no need to keep the encoding key secret.
Bill, there are two different problems with the password issue. One is that if the passwords are stored in cleartext then they are vulnerable. Having a hash function means I can store the has and discard the password. As you say, when I get the password again, I do the hash and compare.
But this does not resolve a trickier issue which is that if the password is transmitted in clear, then someone listening can read it. You would need to encrypt it but even this is not enough. If you transmit a function of the password which is constant then that in effect becomes the password and is vulnerable.
In 1976, the DHM key exchange scheme was invented whereby Alice and Bob could generate a secret common key by exchanging information publicly. Now two people (or computers) who have never met before can generate a secret key by exchanging information publicly and even someone who sees all the information they trade cannot deduce the key. I think that is one of the neatest inventions so I will explain it a bit more.
What you need is a function which is one way (not hash) and commutative, meaning F(a,b) = F(b,a)
Alice picks a number a and Bob picks a number b. Alice sends Bob F(a) and Bob sends Alice F(b). F(a) and F(b) are public but Chuck cannot work back and find a or b. Now Alice does F(b,a) and Bob does F(a,b) and they both have the same number which only they know. And they have done this by trading information openly.
This means that you can agree on a new key each time you send your password and the password will never be compromised.
Yes? Anybody still awake?