Im making some socket servers where users can chat live. I want to add a mute function so users can mute other users that they dont like. I've accomplished this in the following way:on socket connection, a hash is calculated using the users IP with the sha1 algorithmthe hash is cut in half because otherwise its really long.I then send this half hash to all connected users whenever that user posts a messageAll users get the half hash and store it in the metadata of the chat message.If they dont like that message they mute it, and they will no longer see messages from that IP again.My question is: Is it possible to reverse the half hash and get the users IP?Would it be safer if I combine the hash with some arbitrary letters and numbers appended to the users IP?
Submitted December 12, 2018 at 03:00PM by ns_helloworld
No comments:
Post a Comment