Back

In Laravel, how would one encrypt email address of users? Like, it should be only be decrypted by users credentials e.g password etc (which only he knows). But then question arise, how would then app send important emails to that user..?

2

775

In response to @sharoon

Okay there are a few considerations here. If you want to encrypt stuff in your database, you can use Laravel's encryption helpers to encrypt/decrypt Eloquent fields automatically.

BUT: You need to consider the actual security issue you are trying to prevent. Are you trying to protect the database in case of a leak? Because whatever method you use, if your app can decrypt something, that's because the server has access to the secret. And if your database is compromised, then so will that secret be.

This assumes you have the database on the same server sa the app of course. If you use a remote database then encryption at rest may be useful. But in either case, you need to first think about which problem you are trying to solve.

71

  • No matching results...
  • Searching...

/ 1000