8000 sqlcipher/README.md at master · sjemens/sqlcipher · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"art","path":"art","contentType":"directory"},{"name":"autoconf","path":"autoconf","contentType":"directory"},{"name":"contrib","path":"contrib","contentType":"directory"},{"name":"doc","path":"doc","contentType":"directory"},{"name":"ext","path":"ext","contentType":"directory"},{"name":"macosx","path":"macosx","contentType":"directory"},{"name":"mptest","path":"mptest","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"tool","path":"tool","contentType":"directory"},{"name":"vsixtest","path":"vsixtest","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"LICENSE.md","path":"LICENSE.md","contentType":"file"},{"name":"Makefile.in","path":"Makefile.in","contentType":"file"},{"name":"Makefile.linux-gcc","path":"Makefile.linux-gcc","contentType":"file"},{"name":"Makefile.msc","path":"Makefile.msc","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"SQLCipher.podspec.json","path":"SQLCipher.podspec.json","contentType":"file"},{"name":"VERSION","path":"VERSION","contentType":"file"},{"name":"aclocal.m4","path":"aclocal.m4","contentType":"file"},{"name":"config.guess","path":"config.guess","contentType":"file"},{"name":"config.h.in","path":"config.h.in","contentType":"file"},{"name":"config.sub","path":"config.sub","contentType":"file"},{"name":"configure","path":"configure","contentType":"file"},{"name":"configure.ac","path":"configure.ac","contentType":"file"},{"name":"install-sh","path":"install-sh","contentType":"file"},{"name":"ltmain.sh","path":"ltmain.sh","contentType":"file"},{"name":"magic.txt","path":"magic.txt","contentType":"file"},{"name":"main.mk","path":"main.mk","contentType":"file"},{"name":"manifest","path":"manifest","contentType":"file"},{"name":"manifest.uuid","path":"manifest.uuid","contentType":"file"},{"name":"mkso.sh","path":"mkso.sh","contentType":"file"},{"name":"spec.template","path":"spec.template","contentType":"file"},{"name":"sqlcipher-1.1.8-testkey.db","path":"sqlcipher-1.1.8-testkey.db","contentType":"file"},{"name":"sqlcipher-2.0-be-testkey.db","path":"sqlcipher-2.0-be-testkey.db","contentType":"file"},{"name":"sqlcipher-2.0-beta-testkey.db","path":"sqlcipher-2.0-beta-testkey.db","contentType":"file"},{"name":"sqlcipher-2.0-le-testkey.db","path":"sqlcipher-2.0-le-testkey.db","contentType":"file"},{"name":"sqlcipher-3.0-testkey.db","path":"sqlcipher-3.0-testkey.db","contentType":"file"},{"name":"sqlcipher-4.0-testkey.db","path":"sqlcipher-4.0-testkey.db","contentType":"file"},{"name":"sqlcipher.1","path":"sqlcipher.1","contentType":"file"},{"name":"sqlcipher.pc.in","path":"sqlcipher.pc.in","contentType":"file"},{"name":"sqlite.pc.in","path":"sqlite.pc.in","contentType":"file"}],"totalCount":45}},"fileTreeProcessingTime":9.052454999999998,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":123244964,"defaultBranch":"master","name":"sqlcipher","ownerLogin":"sjemens","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2018-02-28T07:12:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/6699118?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1673110053.949845","canEdit":false,"refType":"branch","currentOid":"8763afaf13231cb1fc835b52c94ada23f8e47b3d"},"path":"README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/sjemens/sqlcipher/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/sjemens/sqlcipher/blob/master/README.md?raw=true","headerInfo":{"blobSize":"25 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"51367dc","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fsjemens%2Fsqlcipher%2Fblob%2Fmaster%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":2,"text":"SQLCipher","anchor":"sqlcipher","htmlText":"SQLCipher"},{"level":2,"text":"Features","anchor":"features","htmlText":"Features"},{"level":2,"text":"Compatibility","anchor":"compatibility","htmlText":"Compatibility"},{"level":2,"text":"Contributions","anchor":"contributions","htmlText":"Contributions"},{"level":2,"text":"Compiling","anchor":"compiling","htmlText":"Compiling"},{"level":2,"text":"Testing","anchor":"testing","htmlText":"Testing"},{"level":2,"text":"Encrypting a database","anchor":"encrypting-a-database","htmlText":"Encrypting a database"},{"level":2,"text":"Changing a database key","anchor":"changing-a-database-key","htmlText":"Changing a database key"},{"level":2,"text":"Support","anchor":"support","htmlText":"Support"},{"level":2,"text":"Community Edition Open Source License","anchor":"community-edition-open-source-license","htmlText":"Community Edition Open Source License"},{"level":1,"text":"Begin SQLite README.md","anchor":"begin-sqlite-readmemd","htmlText":"Begin SQLite README.md"},{"level":1,"text":"SQLite Source Repository","anchor":"sqlite-source-repository","htmlText":"SQLite Source Repository"},{"level":2,"text":"Version Control","anchor":"version-control","htmlText":"Version Control"},{"level":2,"text":"Obtaining The Code","anchor":"obtaining-the-code","htmlText":"Obtaining The Code"},{"level":2,"text":"Compiling for Unix-like systems","anchor":"compiling-for-unix-like-systems","htmlText":"Compiling for Unix-like systems"},{"level":2,"text":"Using MSVC for Windows systems","anchor":"using-msvc-for-windows-systems","htmlText":"Using MSVC for Windows systems"},{"level":2,"text":"Source Code Tour","anchor":"source-code-tour","htmlText":"Source Code Tour"},{"level":3,"text":"Generated Source Code Files","anchor":"generated-source-code-files","htmlText":"Generated Source Code Files"},{"level":3,"text":"The Amalgamation","anchor":"the-amalgamation","htmlText":"The Amalgamation"},{"level":2,"text":"How It All Fits Together","anchor":"how-it-all-fits-together","htmlText":"How It All Fits Together"},{"level":2,"text":"Verifying Code Authenticity","anchor":"verifying-code-authenticity","htmlText":"Verifying Code Authenticity"},{"level":2,"text":"Contacts","anchor":"contacts","htmlText":"Contacts"}],"lineInfo":{"truncatedLoc":"491","truncatedSloc":"372"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/sjemens/sqlcipher/blob/master/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/sjemens/sqlcipher/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/sjemens/sqlcipher/raw/refs/heads/master/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSQLCipher\u003c/h2\u003e\u003ca id=\"user-content-sqlcipher\" class=\"anchor\" aria-label=\"Permalink: SQLCipher\" href=\"#sqlcipher\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSQLCipher is a standalone fork of the \u003ca href=\"https://www.sqlite.org/\" rel=\"nofollow\"\u003eSQLite\u003c/a\u003e database library that adds 256 bit AES encryption of database files and other security features like:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eon-the-fly encryption\u003c/li\u003e\n\u003cli\u003etamper detection\u003c/li\u003e\n\u003cli\u003ememory sanitization\u003c/li\u003e\n\u003cli\u003estrong key derivation\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eSQLCipher is based on SQLite and stable upstream release features are periodically integrated. While SQLCipher is maintained as a separate version of the source tree, the project minimizes alterations to core SQLite code whenever possible.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSQLCipher is maintained by Zetetic, LLC, and additional information and documentation is available on the official \u003ca href=\"https://www.zetetic.net/sqlcipher/\" rel=\"nofollow\"\u003eSQLCipher site\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFeatures\u003c/h2\u003e\u003ca id=\"user-content-features\" class=\"anchor\" aria-label=\"Permalink: Features\" href=\"#features\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eFast performance with as little as 5-15% overhead for encryption on many operations\u003c/li\u003e\n\u003cli\u003e100% of data in the database file is encrypted\u003c/li\u003e\n\u003cli\u003eGood security practices (CBC mode, HMAC, key derivation)\u003c/li\u003e\n\u003cli\u003eZero-configuration and application level cryptography\u003c/li\u003e\n\u003cli\u003eAlgorithms provided by the peer reviewed OpenSSL crypto library.\u003c/li\u003e\n\u003cli\u003eConfigurable crypto providers\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCompatibility\u003c/h2\u003e\u003ca id=\"user-content-compatibility\" class=\"anchor\" aria-label=\"Permalink: Compatibility\" href=\"#compatibility\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSQLCipher maintains database format compatibility within the same major version number so an application on any platform can open databases created by any other application provided the major version of SQLCipher is the same between them. However, major version updates (e.g. from 3.x to 4.x) often include changes to default settings. This means that newer major versions of SQLCipher will not open databases created by older versions without using special settings. For example, SQLCipher 4 introduces many new performance and security enhancements. The new default algorithms, increased KDF iterations, and larger page size mean that SQLCipher 4 will not open databases created by SQLCipher 1.x, 2.x, or 3.x by default. Instead, an application would either need to migrate the older databases to use the new format or enable a special backwards-compatibility mode. The available options are described in SQLCipher's \u003ca href=\"https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283\" rel=\"nofollow\"\u003eupgrade documentation\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSQLCipher is also compatible with standard SQLite databases. When a key is not provided, SQLCipher will behave just like the standard SQLite library. It is also possible to convert from a plaintext database (standard SQLite) to an encrypted SQLCipher database using \u003ca href=\"https://discuss.zetetic.net/t/how-to-encrypt-a-plaintext-sqlite-database-to-use-sqlcipher-and-avoid-file-is-encrypted-or-is-not-a-database-errors/868\" rel=\"nofollow\"\u003eATTACH and the sqlcipher_export() convenience function\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eContributions\u003c/h2\u003e\u003ca id=\"user-content-contributions\" class=\"anchor\" aria-label=\"Permalink: Contributions\" href=\"#contributions\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe SQLCipher team welcomes contributions to the core library. All contributions including pull requests and patches should be based on the \u003ccode\u003eprerelease\u003c/code\u003e branch, and must be accompanied by a \u003ca href=\"https://www.zetetic.net/contributions/\" rel=\"nofollow\"\u003econtributor agreement\u003c/a\u003e. We strongly encourage \u003ca href=\"https://discuss.zetetic.net/c/sqlcipher\" rel=\"nofollow\"\u003ediscussion\u003c/a\u003e of the proposed change prior to development and submission.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCompiling\u003c/h2\u003e\u003ca id=\"user-content-compiling\" class=\"anchor\" aria-label=\"Permalink: Compiling\" href=\"#compiling\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBuilding SQLCipher is similar to compiling a regular version of SQLite from source, with a couple of small exceptions:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eYou \u003cem\u003emust\u003c/em\u003e define \u003ccode\u003eSQLITE_HAS_CODEC\u003c/code\u003e and either \u003ccode\u003eSQLITE_TEMP_STORE=2\u003c/code\u003e or \u003ccode\u003eSQLITE_TEMP_STORE=3\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eYou will need to link against a support cryptographic provider (OpenSSL, LibTomCrypt, CommonCrypto/Security.framework, or NSS)\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eThe following examples demonstrate linking against OpenSSL, which is a readily available provider on most Unix-like systems.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eExample 1. Static linking (replace /opt/local/lib with the path to libcrypto.a). Note in this\nexample, \u003ccode\u003e--enable-tempstore=yes\u003c/code\u003e is setting \u003ccode\u003eSQLITE_TEMP_STORE=2\u003c/code\u003e for the build.\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"$ ./configure --enable-tempstore=yes CFLAGS=\u0026quot;-DSQLITE_HAS_CODEC\u0026quot; \\\n\tLDFLAGS=\u0026quot;/opt/local/lib/libcrypto.a\u0026quot;\n$ make\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e$ ./configure --enable-tempstore=yes CFLAGS=\"-DSQLITE_HAS_CODEC\" \\\n\tLDFLAGS=\"/opt/local/lib/libcrypto.a\"\n$ make\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eExample 2. Dynamic linking\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"$ ./configure --enable-tempstore=yes CFLAGS=\u0026quot;-DSQLITE_HAS_CODEC\u0026quot; \\\n\tLDFLAGS=\u0026quot;-lcrypto\u0026quot;\n$ make\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e$ ./configure --enable-tempstore=yes CFLAGS=\"-DSQLITE_HAS_CODEC\" \\\n\tLDFLAGS=\"-lcrypto\"\n$ make\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTesting\u003c/h2\u003e\u003ca id=\"user-content-testing\" class=\"anchor\" aria-label=\"Permalink: Testing\" href=\"#testing\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe full SQLite test suite will not complete successfully when using SQLCipher. In some cases encryption interferes with low-level tests that require access to database file data or features which are unsupported by SQLCipher. Those tests that are intended to support encryption are intended for non-SQLCipher implementations. In addition, because SQLite tests are not always isolated, if one test fails it can trigger a domino effect with other failures in later steps.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAs a result, the SQLCipher package includes it's own independent tests that exercise and verify the core functionality of the SQLCipher extensions. This test suite is intended to provide an abbreviated verification of SQLCipher's internal logic; it does not perform an exhaustive test of the SQLite database system as a whole or verify functionality on specific platforms. Because SQLCipher is based on stable upstream builds of SQLite, it is considered a basic assumption that the core SQLite library code is operating properly (the SQLite core is almost untouched in SQLCipher). Thus, the additional SQLCipher-specific test provide the requisite verification that the library is operating as expected with SQLCipher's security features enabled.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo run SQLCipher specific tests, configure as described here and run the following to execute the tests and receive a report of the results:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"$ ./configure --enable-tempstore=yes --enable-fts5 CFLAGS=\u0026quot;-DSQLITE_HAS_CODEC -DSQLCIPHER_TEST\u0026quot; \\\n\tLDFLAGS=\u0026quot;-lcrypto\u0026quot;\n$ make testfixture\n$ ./testfixture test/sqlcipher.test\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e$ ./configure --enable-tempstore=yes --enable-fts5 CFLAGS=\"-DSQLITE_HAS_CODEC -DSQLCIPHER_TEST\" \\\n\tLDFLAGS=\"-lcrypto\"\n$ make testfixture\n$ ./testfixture test/sqlcipher.test\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEncrypting a database\u003c/h2\u003e\u003ca id=\"user-content-encrypting-a-database\" class=\"anchor\" aria-label=\"Permalink: Encrypting a database\" href=\"#encrypting-a-database\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo specify an encryption passphrase for the database via the SQL interface you\nuse a PRAGMA. The passphrase you enter is passed through PBKDF2 key derivation to\nobtain the encryption key for the database\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"PRAGMA key = 'passphrase';\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003ePRAGMA key = 'passphrase';\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAlternately, you can specify an exact byte sequence using a blob literal. If you\nuse this method it is your responsibility to ensure that the data you provide is a\n64 character hex string, which will be converted directly to 32 bytes (256 bits) of\nkey data without key derivation.\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"PRAGMA key = \u0026quot;x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'\u0026quot;;\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003ePRAGMA key = \"x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'\";\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo encrypt a database programmatically you can use the \u003ccode\u003esqlite3_key\u003c/code\u003e function.\nThe data provided in \u003ccode\u003epKey\u003c/code\u003e is converted to an encryption key according to the\nsame rules as \u003ccode\u003ePRAGMA key\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eint sqlite3_key(sqlite3 *db, const void *pKey, int nKey);\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003ePRAGMA key\u003c/code\u003e or \u003ccode\u003esqlite3_key\u003c/code\u003e should be called as the first operation when a database is open.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eChanging a database key\u003c/h2\u003e\u003ca id=\"user-content-changing-a-database-key\" class=\"anchor\" aria-label=\"Permalink: Changing a database key\" href=\"#changing-a-database-key\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo change the encryption passphrase for an existing database you may use the rekey PRAGMA\nafter you've supplied the correct database password;\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"PRAGMA key = 'passphrase'; -- start with the existing database passphrase\nPRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003ePRAGMA key = 'passphrase'; -- start with the existing database passphrase\nPRAGMA rekey = 'new-passphrase'; -- rekey will reencrypt with the new passphrase\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe hex rekey pragma may be used to rekey to a specific binary value\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"PRAGMA rekey = \u0026quot;x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'\u0026quot;;\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003ePRAGMA rekey = \"x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'\";\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis can be accomplished programmatically by using sqlite3_rekey;\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey)\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003esqlite3_rekey(sqlite3 *db, const void *pKey, int nKey)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupport\u003c/h2\u003e\u003ca id=\"user-content-support\" class=\"anchor\" aria-label=\"Permalink: Support\" href=\"#support\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe primary source for complete documentation (design, API, platforms, usage) is the SQLCipher website:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://www.zetetic.net/sqlcipher/documentation\" rel=\"nofollow\"\u003ehttps://www.zetetic.net/sqlcipher/documentation\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe primary avenue for support and discussions is the SQLCipher discuss site:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://discuss.zetetic.net/c/sqlcipher\" rel=\"nofollow\"\u003ehttps://discuss.zetetic.net/c/sqlcipher\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIssues or support questions on using SQLCipher should be entered into the\nGitHub Issue tracker:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/sqlcipher/sqlcipher/issues\"\u003ehttps://github.com/sqlcipher/sqlcipher/issues\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePlease DO NOT post issues, support questions, or other problems to blog\nposts about SQLCipher as we do not monitor them frequently.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you are using SQLCipher in your own software please let us know at\n\u003ca href=\"mailto:support@zetetic.net\"\u003esupport@zetetic.net\u003c/a\u003e!\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCommunity Edition Open Source License\u003c/h2\u003e\u003ca id=\"user-content-community-edition-open-source-license\" class=\"anchor\" aria-label=\"Permalink: Community Edition Open Source License\" href=\"#community-edition-open-source-license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eCopyright (c) 2020, ZETETIC LLC\nAll rights reserved.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n* Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n* Neither the name of the ZETETIC LLC nor the\nnames of its contributors may be used to endorse or promote products\nderived from this software without specific prior written permission.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTHIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BD05 BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBegin SQLite README.md\u003c/h1\u003e\u003ca id=\"user-content-begin-sqlite-readmemd\" class=\"anchor\" aria-label=\"Permalink: Begin SQLite README.md\" href=\"#begin-sqlite-readmemd\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 align=\"center\" tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSQLite Source Repository\u003c/h1\u003e\u003ca id=\"user-content-sqlite-source-repository\" class=\"anchor\" aria-label=\"Permalink: SQLite Source Repository\" href=\"#sqlite-source-repository\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis repository contains the complete source code for the\n\u003ca href=\"https://sqlite.org/\" rel=\"nofollow\"\u003eSQLite database engine\u003c/a\u003e. Some test scripts\nare also included. However, many other test scripts\nand most of the documentation are managed separately.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eVersion Control\u003c/h2\u003e\u003ca id=\"user-content-version-control\" class=\"anchor\" aria-label=\"Permalink: Version Control\" href=\"#version-control\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSQLite sources are managed using the\n\u003ca href=\"https://www.fossil-scm.org/\" rel=\"nofollow\"\u003eFossil\u003c/a\u003e, a distributed version control system\nthat was specifically designed and written to support SQLite development.\nThe \u003ca href=\"https://sqlite.org/src/timeline\" rel=\"nofollow\"\u003eFossil repository\u003c/a\u003e contains the urtext.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you are reading this on GitHub or some other Git repository or service,\nthen you are looking at a mirror. The names of check-ins and\nother artifacts in a Git mirror are different from the official\nnames for those objects. The official names for check-ins are\nfound in a footer on the check-in comment for authorized mirrors.\nThe official check-in name can also be seen in the \u003ccode\u003emanifest.uuid\u003c/code\u003e file\nin the root of the tree. Always use the official name, not the\nGit-name, when communicating about an SQLite check-in.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you pulled your SQLite source code from a secondary source and want to\nverify its integrity, there are hints on how to do that in the\n\u003ca href=\"#vauth\"\u003eVerifying Code Authenticity\u003c/a\u003e section below.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eObtaining The Code\u003c/h2\u003e\u003ca id=\"user-content-obtaining-the-code\" class=\"anchor\" aria-label=\"Permalink: Obtaining The Code\" href=\"#obtaining-the-code\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you do not want to use Fossil, you can download tarballs or ZIP\narchives or \u003ca href=\"https://sqlite.org/cli.html#sqlar\" rel=\"nofollow\"\u003eSQLite archives\u003c/a\u003e as follows:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eLatest trunk check-in as\n\u003ca href=\"https://www.sqlite.org/src/tarball/sqlite.tar.gz\" rel=\"nofollow\"\u003eTarball\u003c/a\u003e,\n\u003ca href=\"https://www.sqlite.org/src/zip/sqlite.zip\" rel=\"nofollow\"\u003eZIP-archive\u003c/a\u003e, or\n\u003ca href=\"https://www.sqlite.org/src/sqlar/sqlite.sqlar\" rel=\"nofollow\"\u003eSQLite-archive\u003c/a\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eLatest release as\n\u003ca href=\"https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release\" rel=\"nofollow\"\u003eTarball\u003c/a\u003e,\n\u003ca href=\"https://www.sqlite.org/src/zip/sqlite.zip?r=release\" rel=\"nofollow\"\u003eZIP-archive\u003c/a\u003e, or\n\u003ca href=\"https://www.sqlite.org/src/sqlar/sqlite.sqlar?r=release\" rel=\"nofollow\"\u003eSQLite-archive\u003c/a\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eFor other check-ins, substitute an appropriate branch name or\ntag or hash prefix in place of \"release\" in the URLs of the previous\nbullet. Or browse the \u003ca href=\"https://www.sqlite.org/src/timeline\" rel=\"nofollow\"\u003etimeline\u003c/a\u003e\nto locate the check-in desired, click on its information page link,\nthen click on the \"Tarball\" or \"ZIP Archive\" links on the information\npage.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eIf you do want to use Fossil to check out the source tree,\nfirst install Fossil version 2.0 or later.\n(Source tarballs and precompiled binaries available\n\u003ca href=\"https://www.fossil-scm.org/fossil/uv/download.html\" rel=\"nofollow\"\u003ehere\u003c/a\u003e. Fossil is\na stand-alone program. To install, simply download or build the single\nexecutable file and put that file someplace on your $PATH.)\nThen run commands like this:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" mkdir -p ~/sqlite ~/Fossils\n cd ~/sqlite\n fossil clone https://www.sqlite.org/src ~/Fossils/sqlite.fossil\n fossil open ~/Fossils/sqlite.fossil\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e mkdir -p ~/sqlite ~/Fossils\n cd ~/sqlite\n fossil clone https://www.sqlite.org/src ~/Fossils/sqlite.fossil\n fossil open ~/Fossils/sqlite.fossil\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAfter setting up a repository using the steps above, you can always\nupdate to the latest version using:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" fossil update trunk ;# latest trunk check-in\n fossil update release ;# latest official release\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e fossil update trunk ;# latest trunk check-in\n fossil update release ;# latest official release\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOr type \"fossil ui\" to get a web-based user interface.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCompiling for Unix-like systems\u003c/h2\u003e\u003ca id=\"user-content-compiling-for-unix-like-systems\" class=\"anchor\" aria-label=\"Permalink: Compiling for Unix-like systems\" href=\"#compiling-for-unix-like-systems\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFirst create a directory in which to place\nthe build products. It is recommended, but not required, that the\nbuild directory be separate from the source directory. Cd into the\nbuild directory and then from the build directory run the configure\nscript found at the root of the source tree. Then run \"make\".\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor example:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" tar xzf sqlite.tar.gz ;# Unpack the source tree into \u0026quot;sqlite\u0026quot;\n mkdir bld ;# Build will occur in a sibling directory\n cd bld ;# Change to the build directory\n ../sqlite/configure ;# Run the configure script\n make ;# Run the makefile.\n make sqlite3.c ;# Build the \u0026quot;amalgamation\u0026quot; source file\n make test ;# Run some tests (requires Tcl)\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e tar xzf sqlite.tar.gz ;# Unpack the source tree into \"sqlite\"\n mkdir bld ;# Build will occur in a sibling directory\n cd bld ;# Change to the build directory\n ../sqlite/configure ;# Run the configure script\n make ;# Run the makefile.\n make sqlite3.c ;# Build the \"amalgamation\" source file\n make test ;# Run some tests (requires Tcl)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSee the makefile for additional targets.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe configure script uses autoconf 2.61 and libtool. If the configure\nscript does not work out for you, there is a generic makefile named\n\"Makefile.linux-gcc\" in the top directory of the source tree that you\ncan copy and edit to suit your needs. Comments on the generic makefile\nshow what changes are needed.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsing MSVC for Windows systems\u003c/h2\u003e\u003ca id=\"user-content-using-msvc-for-windows-systems\" class=\"anchor\" aria-label=\"Permalink: Using MSVC for Windows systems\" href=\"#using-msvc-for-windows-systems\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOn Windows, all applicable build products can be compiled with MSVC.\nFirst open the command prompt window associated with the desired compiler\nversion (e.g. \"Developer Command Prompt for VS2013\"). Next, use NMAKE\nwith the provided \"Makefile.msc\" to build one of the supported targets.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor example, from the parent directory of the source subtree named \"sqlite\":\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" mkdir bld\n cd bld\n nmake /f ..\\sqlite\\Makefile.msc TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.c TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.dll TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.exe TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc test TOP=..\\sqlite\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e mkdir bld\n cd bld\n nmake /f ..\\sqlite\\Makefile.msc TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.c TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.dll TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc sqlite3.exe TOP=..\\sqlite\n nmake /f ..\\sqlite\\Makefile.msc test TOP=..\\sqlite\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are several build options that can be set via the NMAKE command\nline. For example, to build for WinRT, simply add \"FOR_WINRT=1\" argument\nto the \"sqlite3.dll\" command line above. When debugging into the SQLite\ncode, adding the \"DEBUG=1\" argument to one of the above command lines is\nrecommended.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSQLite does not require \u003ca href=\"http://www.tcl.tk/\" rel=\"nofollow\"\u003eTcl\u003c/a\u003e to run, but a Tcl installation\nis required by the makefiles (including those for MSVC). SQLite contains\na lot of generated code and Tcl is used to do much of that code generation.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSource Code Tour\u003c/h2\u003e\u003ca id=\"user-content-source-code-tour\" class=\"anchor\" aria-label=\"Permalink: Source Code Tour\" href=\"#source-code-tour\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMost of the core source files are in the \u003cstrong\u003esrc/\u003c/strong\u003e subdirectory. The\n\u003cstrong\u003esrc/\u003c/strong\u003e folder also contains files used to build the \"testfixture\" test\nharness. The names of the source files used by \"testfixture\" all begin\nwith \"test\".\nThe \u003cstrong\u003esrc/\u003c/strong\u003e also contains the \"shell.c\" file\nwhich is the main program for the \"sqlite3.exe\"\n\u003ca href=\"https://sqlite.org/cli.html\" rel=\"nofollow\"\u003ecommand-line shell\u003c/a\u003e and\nthe \"tclsqlite.c\" file which implements the\n\u003ca href=\"https://sqlite.org/tclsqlite.html\" rel=\"nofollow\"\u003eTcl bindings\u003c/a\u003e for SQLite.\n(Historical note: SQLite began as a Tcl\nextension and only later escaped to the wild as an independent library.)\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTest scripts and programs are found in the \u003cstrong\u003etest/\u003c/strong\u003e subdirectory.\nAdditional test code is found in other source repositories.\nSee \u003ca href=\"http://www.sqlite.org/testing.html\" rel=\"nofollow\"\u003eHow SQLite Is Tested\u003c/a\u003e for\nadditional information.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003cstrong\u003eext/\u003c/strong\u003e subdirectory contains code for extensions. The\nFull-text search engine is in \u003cstrong\u003eext/fts3\u003c/strong\u003e. The R-Tree engine is in\n\u003cstrong\u003eext/rtree\u003c/strong\u003e. The \u003cstrong\u003eext/misc\u003c/strong\u003e subdirectory contains a number of\nsmaller, single-file extensions, such as a REGEXP operator.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003cstrong\u003etool/\u003c/strong\u003e subdirectory contains various scripts and programs used\nfor building generated source code files or for testing or for generating\naccessory programs such as \"sqlite3_analyzer(.exe)\".\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGenerated Source Code Files\u003c/h3\u003e\u003ca id=\"user-content-generated-source-code-files\" class=\"anchor\" aria-label=\"Permalink: Generated Source Code Files\" href=\"#generated-source-code-files\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSeveral of the C-language source files used by SQLite are generated from\nother sources rather than being typed in manually by a programmer. This\nsection will summarize those automatically-generated files. To create all\nof the automatically-generated files, simply run \"make target_source\".\nThe \"target_source\" make target will create a subdirectory \"tsrc/\" and\nfill it with all the source files needed to build SQLite, both\nmanually-edited files and automatically-generated files.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe SQLite interface is defined by the \u003cstrong\u003esqlite3.h\u003c/strong\u003e header file, which is\ngenerated from src/sqlite.h.in, ./manifest.uuid, and ./VERSION. The\n\u003ca href=\"http://www.tcl.tk\" rel=\"nofollow\"\u003eTcl script\u003c/a\u003e at tool/mksqlite3h.tcl does the conversion.\nThe manifest.uuid file contains the SHA3 hash of the particular check-in\nand is used to generate the SQLITE_SOURCE_ID macro. The VERSION file\ncontains the current SQLite version number. The sqlite3.h header is really\njust a copy of src/sqlite.h.in with the source-id and version number inserted\nat just the right spots. Note that comment text in the sqlite3.h file is\nused to generate much of the SQLite API documentation. The Tcl scripts\nused to generate that documentation are in a separate source repository.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe SQL language parser is \u003cstrong\u003eparse.c\u003c/strong\u003e which is generated from a grammar in\nthe src/parse.y file. The conversion of \"parse.y\" into \"parse.c\" is done\nby the \u003ca href=\"/sjemens/sqlcipher/blob/master/doc/lemon.html\"\u003elemon\u003c/a\u003e LALR(1) parser generator. The source code\nfor lemon is at tool/lemon.c. Lemon uses the tool/lempar.c file as a\ntemplate for generating its parser.\nLemon also generates the \u003cstrong\u003eparse.h\u003c/strong\u003e header file, at the same time it\ngenerates parse.c.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003cstrong\u003eopcodes.h\u003c/strong\u003e header file contains macros that define the numbers\ncorresponding to opcodes in the \"VDBE\" virtual machine. The opcodes.h\nfile is generated by scanning the src/vdbe.c source file. The\nTcl script at ./mkopcodeh.tcl does this scan and generates opcodes.h.\nA second Tcl script, ./mkopcodec.tcl, then scans opcodes.h to generate\nthe \u003cstrong\u003eopcodes.c\u003c/strong\u003e source file, which contains a reverse mapping from\nopcode-number to opcode-name that is used for EXPLAIN output.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003cstrong\u003ekeywordhash.h\u003c/strong\u003e header file contains the definition of a hash table\nthat maps SQL language keywords (ex: \"CREATE\", \"SELECT\", \"INDEX\", etc.) into\nthe numeric codes used by the parse.c parser. The keywordhash.h file is\ngenerated by a C-language program at tool mkkeywordhash.c.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003cstrong\u003epragma.h\u003c/strong\u003e header file contains various definitions used to parse\nand implement the PRAGMA statements. The header is generated by a\nscript \u003cstrong\u003etool/mkpragmatab.tcl\u003c/strong\u003e. If you want to add a new PRAGMA, edit\nthe \u003cstrong\u003etool/mkpragmatab.tcl\u003c/strong\u003e file to insert the information needed by the\nparser for your new PRAGMA, then run the script to regenerate the\n\u003cstrong\u003epragma.h\u003c/strong\u003e header file.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eThe Amalgamation\u003c/h3\u003e\u003ca id=\"user-content-the-amalgamation\" class=\"anchor\" aria-label=\"Permalink: The Amalgamation\" href=\"#the-amalgamation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAll of the individual C source code and header files (both manually-edited\nand automatically-generated) can be combined into a single big source file\n\u003cstrong\u003esqlite3.c\u003c/strong\u003e called \"the amalgamation\". The amalgamation is the recommended\nway of using SQLite in a larger application. Combining all individual\nsource code files into a single big source code file allows the C compiler\nto perform more cross-procedure analysis and generate better code. SQLite\nruns about 5% faster when compiled from the amalgamation versus when compiled\nfrom individual source files.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe amalgamation is generated from the tool/mksqlite3c.tcl Tcl script.\nFirst, all of the individual source files must be gathered into the tsrc/\nsubdirectory (using the equivalent of \"make target_source\") then the\ntool/mksqlite3c.tcl script is run to copy them all together in just the\nright order while resolving internal \"#include\" references.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe amalgamation source file is more than 200K lines long. Some symbolic\ndebuggers (most notably MSVC) are unable to deal with files longer than 64K\nlines. To work around this, a separate Tcl script, tool/split-sqlite3c.tcl,\ncan be run on the amalgamation to break it up into a single small C file\ncalled \u003cstrong\u003esqlite3-all.c\u003c/strong\u003e that does #include on about seven other files\nnamed \u003cstrong\u003esqlite3-1.c\u003c/strong\u003e, \u003cstrong\u003esqlite3-2.c\u003c/strong\u003e, ..., \u003cstrong\u003esqlite3-7.c\u003c/strong\u003e. In this way,\nall of the source code is contained within a single translation unit so\nthat the compiler can do extra cross-procedure optimization, but no\nindividual source file exceeds 32K lines in length.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHow It All Fits Together\u003c/h2\u003e\u003ca id=\"user-content-how-it-all-fits-together\" class=\"anchor\" aria-label=\"Permalink: How It All Fits Together\" href=\"#how-it-all-fits-together\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSQLite is modular in design.\nSee the \u003ca href=\"http://www.sqlite.org/arch.html\" rel=\"nofollow\"\u003earchitectural description\u003c/a\u003e\nfor details. Other documents that are useful in\n(helping to understand how SQLite works include the\n\u003ca href=\"http://www.sqlite.org/fileformat2.html\" rel=\"nofollow\"\u003efile format\u003c/a\u003e description,\nthe \u003ca href=\"http://www.sqlite.org/opcode.html\" rel=\"nofollow\"\u003evirtual machine\u003c/a\u003e that runs\nprepared statements, the description of\n\u003ca href=\"http://www.sqlite.org/atomiccommit.html\" rel=\"nofollow\"\u003ehow transactions work\u003c/a\u003e, and\nthe \u003ca href=\"http://www.sqlite.org/optoverview.html\" rel=\"nofollow\"\u003eoverview of the query planner\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYears of effort have gone into optimizing SQLite, both\nfor small size and high performance. And optimizations tend to result in\ncomplex code. So there is a lot of complexity in the current SQLite\nimplementation. It will not be the easiest library in the world to hack.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eKey files:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003esqlite.h.in\u003c/strong\u003e - This file defines the public interface to the SQLite\nlibrary. Readers will need to be familiar with this interface before\ntrying to understand how the library works internally.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003esqliteInt.h\u003c/strong\u003e - this header file defines many of the data objects\nused internally by SQLite. In addition to \"sqliteInt.h\", some\nsubsystems have their own header files.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eparse.y\u003c/strong\u003e - This file describes the LALR(1) grammar that SQLite uses\nto parse SQL statements, and the actions that are taken at each step\nin the parsing process.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003evdbe.c\u003c/strong\u003e - This file implements the virtual machine that runs\nprepared statements. There are various helper files whose names\nbegin with \"vdbe\". The VDBE has access to the vdbeInt.h header file\nwhich defines internal data objects. The rest of SQLite interacts\nwith the VDBE through an interface defined by vdbe.h.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ewhere.c\u003c/strong\u003e - This file (together with its helper files named\nby \"where*.c\") analyzes the WHERE clause and generates\nvirtual machine code to run queries efficiently. This file is\nsometimes called the \"query optimizer\". It has its own private\nheader file, whereInt.h, that defines data objects used internally.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ebtree.c\u003c/strong\u003e - This file contains the implementation of the B-Tree\nstorage engine used by SQLite. The interface to the rest of the system\nis defined by \"btree.h\". The \"btreeInt.h\" header defines objects\nused internally by btree.c and not published to the rest of the system.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003epager.c\u003c/strong\u003e - This file contains the \"pager\" implementation, the\nmodule that implements transactions. The \"pager.h\" header file\ndefines the interface between pager.c and the rest of the system.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eos_unix.c\u003c/strong\u003e and \u003cstrong\u003eos_win.c\u003c/strong\u003e - These two files implement the interface\nbetween SQLite and the underlying operating system using the run-time\npluggable VFS interface.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eshell.c.in\u003c/strong\u003e - This file is not part of the core SQLite library. This\nis the file that, when linked against sqlite3.a, generates the\n\"sqlite3.exe\" command-line shell. The \"shell.c.in\" file is transformed\ninto \"shell.c\" as part of the build process.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003etclsqlite.c\u003c/strong\u003e - This file implements the Tcl bindings for SQLite. It\nis not part of the core SQLite library. But as most of the tests in this\nrepository are written in Tcl, the Tcl language bindings are important.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cem\u003e\u003cem\u003etest\u003c/em\u003e.c\u003c/em\u003e* - Files in the src/ folder that begin with \"test\" go into\nbuilding the \"testfixture.exe\" program. The testfixture.exe program is\nan enhanced Tcl shell. The testfixture.exe program runs scripts in the\ntest/ folder to validate the core SQLite code. The testfixture program\n(and some other test programs too) is built and run when you type\n\"make test\".\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eext/misc/json1.c\u003c/strong\u003e - This file implements the various JSON functions\nthat are built into SQLite.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eThere are many other source files. Each has a succinct header comment that\ndescribes its purpose and role within the larger system.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca name=\"user-content-vauth\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eVerifying Code Authenticity\u003c/h2\u003e\u003ca id=\"user-content-verifying-code-authenticity\" class=\"anchor\" aria-label=\"Permalink: Verifying Code Authenticity\" href=\"#verifying-code-authenticity\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003emanifest\u003c/code\u003e file at the root directory of the source tree\ncontains either a SHA3-256 hash (for newer files) or a SHA1 hash (for\nolder files) for every source file in the repository.\nThe name of the version of the entire source tree is just the\nSHA3-256 hash of the \u003ccode\u003emanifest\u003c/code\u003e file itself, possibly with the\nlast line of that file omitted if the last line begins with\n\"\u003ccode\u003e# Remove this line\u003c/code\u003e\".\nThe \u003ccode\u003emanifest.uuid\u003c/code\u003e file should contain the SHA3-256 hash of the\n\u003ccode\u003emanifest\u003c/code\u003e file. If all of the above hash comparisons are correct, then\nyou can be confident that your source tree is authentic and unadulterated.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe format of the \u003ccode\u003emanifest\u003c/code\u003e file should be mostly self-explanatory, but\nif you want details, they are available\n\u003ca href=\"https://fossil-scm.org/fossil/doc/trunk/www/fileformat.wiki#manifest\" rel=\"nofollow\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eContacts\u003c/h2\u003e\u003ca id=\"user-content-contacts\" class=\"anchor\" aria-label=\"Permalink: Contacts\" href=\"#contacts\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe main SQLite website is \u003ca href=\"http://www.sqlite.org/\" rel=\"nofollow\"\u003ehttp://www.sqlite.org/\u003c/a\u003e\nwith geographically distributed backups at\n\u003ca href=\"http://www2.sqlite.org\" rel=\"nofollow\"\u003ehttp://www2.sqlite.org/\u003c/a\u003e and\n\u003ca href=\"http://www3.sqlite.org\" rel=\"nofollow\"\u003ehttp://www3.sqlite.org/\u003c/a\u003e.\u003c/p\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/sjemens/sqlcipher/branches":{"post":"k3PclukqDXmU6OM5EwctSv8nq4G6YsENsiPFkL3y1Lm-n7IZcTZhbUbeUv4w9o6ewSYZhv9UQ0P-_kuFE8XWMQ"},"/repos/preferences":{"post":"tl6Z_bUVZNKDpfjpsG6rAvf01eoPPyBc8NOEztnJ25r-25oyBPK_64WiLmg31VXwL9IM0KlfzEVaPKczouI5_A"}}},"title":"sqlcipher/README.md at master · sjemens/sqlcipher","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0