I have a server with a known public key: P. User u needs to send the server some data. Therefore, he sends (data) encrypted with P along with sha256(data) as the signature. A. is this secure? B. Is it an information leak transmitting the hash in plaintext? All types of attacks welcome. Note: man in the middle should be no better than man pretending to be.
As far as I see it, if the data is changed the attacker cannot recompute the correct hash of the new text. If new data is created to replace the given information then we have man pretending to be. If the hash is dropped or is incorrect then the server errors. Am I missing something? Should the hash be included in the encrypted information?
Thanks!