Skip to main content


This integration can be used to encrypt and decrypt data transparently when reading and writing to the database, using CYBERCRYPT D1 Generic. The data is encrypted in the application layer in such a way that the database itself never receives the data in plain text.

This protects the data in the database from being read by third parties and tampering.

Supported databases

All databases supported by GORM are supported by the d1gorm package. These include:

  • MySQL
  • PostgreSQL
  • SQL Server
  • SQLite
  • any database that is compatible with the mysql or postgres dialects.


You can install the d1gorm package in your go project by running:

go get


For examples of how to use the integration see our examples in the godoc.


  • Currently only string and []byte data fields can be encrypted.
  • Encrypted data is not searchable by the database.


The software in the CYBERCRYPT d1-gorm repository is licensed under the Apache License 2.0.