A step-by-step example of encrypting sensitive data in Elixir Phoenix apps using Ecto custom types before storing in a database.
Phoenix Ecto Encryption Example is a detailed tutorial and code example that demonstrates how to implement field-level encryption in Elixir Phoenix applications. It shows how to encrypt sensitive user data before storing it in a database using custom Ecto types, addressing the critical need for personal data protection in web applications. The project solves the problem of securing personal information like names and email addresses while maintaining application functionality.
Elixir/Phoenix developers and technical decision makers who need to implement robust data encryption in their applications. It's particularly valuable for developers building applications that handle personal data and require compliance with data protection regulations.
Developers choose this example because it provides a complete, production-ready implementation of encryption following OWASP best practices, with clear explanations of each step. Unlike generic encryption libraries, it demonstrates the full integration with Phoenix and Ecto, including key rotation and custom type implementation.
🔐 A detailed example for how to encrypt data in an Elixir (Phoenix v1.7) App before inserting into a database using Ecto Types
Provides a step-by-step tutorial that explains encryption concepts from first principles, including detailed code for custom Ecto types and key rotation, making it ideal for deep learning.
Follows OWASP cryptographic storage and password storage cheat sheets by using AES-256-GCM encryption and Argon2 password hashing, ensuring industry-standard security.
Includes practical implementations like key rotation with environment variable management and custom Ecto types for automatic encryption/decryption, derived from real-world use.
Demonstrates full integration with Phoenix and Ecto, including schema changes, testing, and environment setup, covering the entire workflow from encryption to database storage.
The README explicitly recommends using the 'fields' library for production, indicating this example is primarily educational and may lack updates, bug fixes, or community support.
Requires copying and adapting code from the example, which involves manual setup of Ecto types, key management, and testing, increasing the risk of errors compared to using a pre-built solution.
Tied exclusively to Elixir, Phoenix, and Ecto, so it's not applicable for other programming languages, databases, or frameworks without significant rework.
Users must handle key generation, rotation, and algorithm updates themselves, which adds operational complexity and potential security gaps if not managed rigorously.
Web application that indexes all popular torrent sites, and saves it to the local database.
Changelog makes world-class developer pods. This is our open source platform.
Elixir learning exercises
API server and website for Hex
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.