Can I hash/encrypt or otherwise protect emails in my Django app from hackers?

StackOverflow https://stackoverflow.com/questions/20647081

  •  19-09-2022
  •  | 
  •  

Вопрос

Hoping for a simple function I can use to store emails securely and retrieve easily when required to send emails.

Это было полезно?

Решение

Kind of a general question, but here are a few solutions I'm familiar with:

  • use django-encrypted-fields, which has an EncryptedEmailField
  • you can override the save method for encrypting the email yourself, then override the post_init signal for decryption. See example here (which is based on this)
  • you can build your own encrypted email field, see django snippet here (uses pyCrypto)
  • you can use django-extension's EncryptedCharField
  • If none of the above seems good enough, try google-ing around by yourself. You're probably not the first to tackle this problem

good luck.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top