I want to implement a private messaging system to my website, but I'm wondering if the content of the -supposedly private- message between Alice and Bob should be stored in plain text in the database or it should be encrypted prior to that, so that even if the database is hijacked, the attackers wouldn't be able to read the messages.
So my questions are:
Is this neccessary to do if your site is not a banking/PayPal-like site? Do Facebook, YouTube, etc. do it this way?
How would I go about letting only Alice and Bob decrypt it?
It might be overkill to do this (at least in the website I'm working on), but if I'm going to do it, I guess it's better to do it before launching the site.