Reputation: 29
I want to work on a project where users can send messages to others users that are subscribe to their channels.
I want to ask if it's very necessary to encrypt the messages before storing them in the database? Although some messages may contain some sensitive information.
If yes, how do I go about encrypting the message in laravel and also decrypting it when showing it to the end user?
Upvotes: 0
Views: 1655
Reputation: 11
use Illuminate\Support\Facades\Crypt;
$encrypted = Crypt::encryptString('Hello world.');
$decrypted = Crypt::decryptString($encrypted);
Upvotes: 1
Reputation: 103
You can check Laravel's encryption methods.
Crypt::encryptString('<string>')
Crypt::decryptString($encryptedValue)
Upvotes: 0