SQLCipher License Codes - How to avoid SQLITE_AUTH (23) not authorized errors

Commercial & Enterprise Edition Feature

SQLCipher Commercial and Enterprise packages require the use of a License Code to enable encryption functionality in the product. Failure to provide a license code, or the use of an expired trial code, will result in one of the following errors (depending on the data access API in use):

  • SQLITE_AUTH
  • Result Code 23
  • not authorized

To resolve this issue, provide the license code via the PRAGMA cipher_license API. The general syntax follows:

PRAGMA cipher_license = 'OmNpZDowMDFHMDA...';

This PRAGMA may be invoked either prior to or after keying, but must be run before using any encryption features.

In addition to setting the license code by PRAGMA, it is also possible to provide the license code without modifying the application code. Starting in SQLCipher 4.10.0, the license code value may also be set in:

  • The environmental variable CIPHER_LICENSE
  • A file named cipher_license in the same directory as the SQLCipher library
  • A file named cipher_license in the same directory as the current executable
  • A file named cipher_license in the same directory as the current working directory
  • A file named cipher_license in the Resources directory directory next to the main library in a macOS bundle
  • An arbitrary file path set using the CIPHER_LICENSE_FILE environmental variable

Trial license codes may be requested prior to purchase and are valid for 15 days of testing.

Permanent license codes are delivered electronically after purchase. If you are an active CipherCare subscriber you can request your license codes on the Customer Downloads site.