# fields v2.12.0 - API Reference

## Modules

- [Fields.AES](Fields.AES.md): Encrypt values with AES in Galois/Counter Mode (GCM)
https://en.wikipedia.org/wiki/Galois/Counter_Mode
using a random Initialisation Vector for each encryption,
this makes "bruteforce" decryption much more difficult.
See `encrypt/1` and `decrypt/1` for more details.

- [Fields.Address](Fields.Address.md): An Ecto Type for plaintext addresses.
Useful for publicly available addressses.
See `Fields.AddressEncrypted` for storing addresses
that are Personally Identifiable Information.
- [Fields.AddressEncrypted](Fields.AddressEncrypted.md): An Ecto Type for encrypted addresses.
- [Fields.DescriptionPlaintextUnlimited](Fields.DescriptionPlaintextUnlimited.md): An Ecto Type for plaintext description fields with no length restrictions.
Strips out all HTML tags to avoid XSS.
- [Fields.EmailEncrypted](Fields.EmailEncrypted.md): An Ecto Type for encrypted emails.
- [Fields.EmailHash](Fields.EmailHash.md): An Ecto Type for hashed emails.
Use in conjuction with `Fields.EmailEncrypted` in order to be able to look up database rows by email.
Hashed using sha256. See `Fields.Helpers` for hashing details.
- [Fields.EmailPlaintext](Fields.EmailPlaintext.md): An Ecto Type for plaintext emails.
Useful for publicly available email addressses such as customer support emails.
See `Fields.EmailEncrypted` and `Fields.EmailHash` for storing user email addresses.
- [Fields.Encrypted](Fields.Encrypted.md): An Ecto Type for encrypted fields.
See `Fields.AES` for details on encryption/decryption.
- [Fields.Hash](Fields.Hash.md): An Ecto Type for hashed fields.
Hashed using sha256. See `Fields.Helpers` for hashing details.
- [Fields.Helpers](Fields.Helpers.md): Helper functions for hashing, 
generating (random) salt values
and fetching secrets form environment.

- [Fields.HtmlBody](Fields.HtmlBody.md): An Ecto Type for bodies of html text.
Strips out all HTML script tags to avoid XSS but allows other basic HTML
elements to remain.
- [Fields.IpAddressEncrypted](Fields.IpAddressEncrypted.md): An Ecto Type for encrypted ip addresses.
- [Fields.IpAddressHash](Fields.IpAddressHash.md): An Ecto Type for hashed ip addresses.
Hashed using sha256. See `Fields.Helpers` for hashing details.
- [Fields.IpAddressPlaintext](Fields.IpAddressPlaintext.md): An Ecto Type for plaintext ip address.
- [Fields.Name](Fields.Name.md): An Ecto Type for names that need to be stored securely.
- [Fields.Password](Fields.Password.md): An Ecto Type for hashed passwords.
Hashed using Argon2. See `Fields.Helpers` for hashing details.
- [Fields.PhoneNumber](Fields.PhoneNumber.md): An Ecto Type for plaintext phone numbers.
Useful for publicly available numbers such as customer support.
See `Fields.PhoneNumberEncrypted` for storing numbers that are Personally Identifiable Information.
- [Fields.PhoneNumberEncrypted](Fields.PhoneNumberEncrypted.md): An Ecto Type for encrypted phone numbers.
- [Fields.Postcode](Fields.Postcode.md): An Ecto Type for plaintext postcodes.
Use for publicly available postcodes. For personal data, use `Fields.PostcodeEncrypted` instead.
- [Fields.PostcodeEncrypted](Fields.PostcodeEncrypted.md): An Ecto Type for encrypted postcodes.
See `Fields.AES` for details on encryption/decryption.
- [Fields.Url](Fields.Url.md): An Ecto Type for urls.
Use `Fields.UrlEncrypted` for encrypted urls.
- [Fields.UrlEncrypted](Fields.UrlEncrypted.md): An Ecto Type for urls that need to be stored securely.
- [Fields.Validate](Fields.Validate.md): Helper functions to validate the data in certain fields

