As I understand, there are a few requirements for a good hash function.
- Hard to find any message from a given hash
- Hard to find any 2 messages which give the same hash
- A single bit change in the input message should lead to change of each bit of the output with a probability of 0.5 (as close as possible to 0.5)
- Good collision resistance
So my question is if I have a asymmetric key encryption method, erase off the private key, encrypt the message with the public key, then take the least significant (say) 256 bits. Do I have a good hashing function? Does my hashing function provide some guarantees on the points 3,4? I am fairly sure points 1,2 are fine though. Aren't they?
My aim is to explore the possibility of creating a hash function out of an encryption function. So put aside the fact that messages are usually padded with random information before encryption. Just Encrypt(Message, Public-key).
edit : Some of the answers ask, how can i be sure I destroyed my private key properly. What I can do is even before generating a public/private key pair, I would just create a single random string and call it public key(if the public key has some requirements on the length or other properties, I would generate a string of that particular length). In general I would create a string which is acceptable as an public key by the encryption machine.