-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencrypt-decrypt-sqlcipher.html
More file actions
316 lines (292 loc) · 18 KB
/
Copy pathencrypt-decrypt-sqlcipher.html
File metadata and controls
316 lines (292 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- Favicons -->
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<title>Encrypt and Decrypt SQLite Databases with SQLCipher — DB Browser (Windows)</title>
<meta name="description" content="Step‑by‑step guide to encrypt, decrypt and change passphrases (rekey) using SQLCipher in DB Browser on Windows. Safe workflows, compatibility tips and common pitfalls.">
<link rel="canonical" href="https://db-browser.github.io/encrypt-decrypt-sqlcipher.html">
<!-- Open Graph -->
<meta property="og:title" content="Encrypt and Decrypt SQLite Databases with SQLCipher — DB Browser (Windows)">
<meta property="og:description" content="Create or convert encrypted databases, change passphrases and export unencrypted copies using DB Browser with SQLCipher on Windows.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://db-browser.github.io/encrypt-decrypt-sqlcipher.html">
<meta property="og:image" content="https://db-browser.github.io/og-image.png">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Encrypt and Decrypt SQLite Databases with SQLCipher — DB Browser (Windows)">
<meta name="twitter:description" content="Create or convert encrypted databases, change passphrases and export unencrypted copies using DB Browser with SQLCipher on Windows.">
<meta name="twitter:image" content="https://db-browser.github.io/og-image.png">
<meta name="author" content="Community / Unofficial resource">
<meta name="last-modified" content="">
<!-- Google tag (GA4) + Consent Mode v2: load regardless of consent, default denied -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'wait_for_update': 500
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-N1MPKLJ6KC"></script>
<script>
gtag('js', new Date());
gtag('config', 'G-N1MPKLJ6KC', { 'anonymize_ip': true });
</script>
<!-- Styles (consistent with site) -->
<style>
:root{ --bg:#ffffff; --text:#0b2545; --muted:#6b7280; --accent:#0b63a5; --accent-2:#f7a21a; --card:#f8fafc; --radius:10px; --maxwidth:1100px; --focus:3px solid rgba(11,99,165,0.15); }
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;font-size:16px;line-height:1.6;color:var(--text);background:var(--bg)}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
header{background:linear-gradient(180deg,#ffffff 0%, #f7fbff 100%);border-bottom:1px solid #e6eef6}
.wrap{max-width:var(--maxwidth);margin:0 auto;padding:20px}
.site-header{display:flex;align-items:center;gap:18px;padding:10px 0}
.brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none}
.brand:hover{text-decoration:none}
nav{margin-left:auto}
.nav-list{display:flex;gap:8px;flex-wrap:wrap}
.nav-list a{padding:6px 10px;border-radius:8px;color:var(--text);font-weight:600;font-size:14px;line-height:1}
.nav-list a:focus{outline:var(--focus)}
main{padding:28px 20px}
.card{background:var(--card);padding:16px;border-radius:var(--radius);box-shadow:0 1px 0 rgba(11,99,165,0.03)}
.hero{display:grid;gap:18px;grid-template-columns:1.1fr 0.9fr;align-items:stretch}
.title{font-size:30px;margin:4px 0 6px;color:var(--text);line-height:1.2}
.lead{color:var(--muted);max-width:78ch}
.kicker{color:var(--muted);font-weight:600;font-size:13px}
.cta-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}
.btn{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:10px;border:0;background:var(--accent);color:white;font-weight:700;cursor:pointer}
.btn.secondary{background:#eef6fb;color:var(--accent);border:1px solid #dbeefc;text-decoration:none}
.btn:focus{outline:var(--focus)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.muted{color:var(--muted);font-size:14px}
.list{margin:6px 0 0 18px;color:var(--muted)}
.tip{background:#f0f7ff;border:1px solid #dbeefc;border-radius:10px;padding:10px;margin:10px 0}
.warn{background:#fff7e6;border:1px solid #ffe0a3;border-radius:10px;padding:10px;margin:10px 0;color:#8b5e00}
footer{padding:24px 20px;border-top:1px solid #e6eef6;margin-top:40px}
.footer-grid{display:flex;gap:24px;flex-wrap:wrap;align-items:center}
@media (max-width:899px){.hero{grid-template-columns:1fr}.grid-2{grid-template-columns:1fr}}
@media (max-width:699px){.nav-list{display:none}.mobile-nav{display:flex;margin-left:auto}}
</style>
<!-- Icons -->
<svg style="display:none" aria-hidden="true">
<symbol id="icon-logo" viewBox="0 0 64 64"><rect x="6" y="14" width="52" height="36" rx="4" fill="currentColor" /><path d="M18 22h28M18 30h28M18 38h16" stroke="#fff" stroke-width="2" stroke-linecap="round" /></symbol>
<symbol id="icon-download" viewBox="0 0 24 24"><path d="M12 3v10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 13l7 7 7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 21H3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
</svg>
<!-- JSON-LD: HowTo + Breadcrumbs -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "HowTo",
"name": "Encrypt and Decrypt with SQLCipher in DB Browser (Windows)",
"description": "Create a new encrypted database, convert an existing one, change passphrases (rekey) and export an unencrypted copy.",
"url": "https://db-browser.github.io/encrypt-decrypt-sqlcipher.html",
"step": [
{"@type":"HowToStep","name":"Create a new encrypted database","text":"Use New Database, select SQLCipher and set a strong passphrase. Record cipher settings for compatibility."},
{"@type":"HowToStep","name":"Encrypt an existing database","text":"Use the encryption tool to convert an unencrypted database to SQLCipher. Verify you can reopen it with the same parameters."},
{"@type":"HowToStep","name":"Change passphrase (rekey)","text":"Use the rekey/change passphrase tool to rotate credentials securely."},
{"@type":"HowToStep","name":"Decrypt to a plain copy","text":"Export an unencrypted copy for interoperability where required, then handle it with extra care."}
]
},
{
"@type": "BreadcrumbList",
"itemListElement": [
{"@type":"ListItem", "position": 1, "name": "Home", "item": "https://db-browser.github.io/"},
{"@type":"ListItem", "position": 2, "name": "Encrypt / Decrypt", "item": "https://db-browser.github.io/encrypt-decrypt-sqlcipher.html"}
]
}
]
}
</script>
</head>
<body>
<header>
<div class="wrap site-header" role="banner">
<a class="brand" aria-label="Home" href="/">
<svg width="44" height="44" viewBox="0 0 64 64" fill="var(--accent)"><use href="#icon-logo"></use></svg>
<div>
<div style="font-size:18px;margin:0;font-weight:700;color:var(--text)">DB Browser (SQLCipher) — Windows</div>
<div class="muted" style="font-size:13px">Portable download, guides, troubleshooting</div>
</div>
</a>
<nav aria-label="Main Navigation">
<div class="nav-list">
<a href="/download.html">Download</a>
<a href="/getting-started.html">Getting Started</a>
<a href="/encrypt-decrypt-sqlcipher.html" aria-current="page">Encrypt / Decrypt</a>
<a href="/troubleshooting.html">Troubleshooting</a>
<a href="/migrate-to-sqlcipher.html">Migrate</a>
<a href="/best-practices-security.html">Security</a>
<a href="/alternatives.html">Alternatives</a>
<a href="/faq.html">FAQ</a>
<a href="/about.html">About</a>
</div>
</nav>
<div class="mobile-nav" style="display:none">
<button aria-label="open menu" class="btn secondary" onclick="document.querySelector('.nav-list').style.display='flex'">Menu</button>
</div>
</div>
</header>
<main class="wrap" id="main">
<!-- Hero -->
<section class="hero card" aria-labelledby="title">
<div>
<div class="kicker">Step‑by‑step HowTo • Windows 10/11</div>
<h1 id="title" class="title">Encrypt and Decrypt with SQLCipher in DB Browser</h1>
<p class="lead">Learn safe, repeatable workflows to create a new encrypted database, convert an existing one, rotate passphrases (rekey), and export a plain copy when necessary — all using DB Browser with SQLCipher support.</p>
<div class="cta-row">
<a class="btn" href="/download.html" title="Get the portable build">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" style="margin-right:6px"><use href="#icon-download"></use></svg>
Get the portable build
</a>
<a class="btn secondary" href="/sqlcipher.html">Encryption Basics</a>
<a class="btn secondary" href="/open-encrypted-db.html">Open an Encrypted DB</a>
</div>
</div>
<aside class="card" aria-label="Tips">
<strong>Before you start</strong>
<ul class="muted" style="padding-left:18px;margin:8px 0 0">
<li>Back up your database before encrypting, rekeying or decrypting.</li>
<li>Decide and document cipher settings (page size, iterations) up front.</li>
<li>Use a long, unique passphrase and store it securely.</li>
</ul>
</aside>
</section>
<!-- Encrypt new DB -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Create a new encrypted database</h2>
<ol class="list" style="list-style:decimal">
<li>Open DB Browser and choose <em>New Database</em>.</li>
<li>Select encryption with SQLCipher when prompted and enter a strong passphrase.</li>
<li>Set or confirm cipher options (page size, KDF iterations) if available.</li>
<li>Create your tables and start importing data as needed.</li>
</ol>
<div class="tip">Need a refresher on parameters? Read <a href="/sqlcipher.html">SQLCipher basics</a> and <a href="/performance-tips.html">Performance tips</a>.</div>
</section>
<!-- Encrypt existing DB -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Encrypt an existing unencrypted database</h2>
<p class="muted">Use the built‑in encryption tool to convert a plain SQLite database into a SQLCipher‑encrypted one. Always work on a backup first.</p>
<ol class="list" style="list-style:decimal">
<li>Back up the original database file.</li>
<li>Open the unencrypted database in DB Browser.</li>
<li>Start the <em>Encrypt/Set Encryption</em> action and choose SQLCipher.</li>
<li>Enter a strong passphrase and confirm cipher settings.</li>
<li>Save and reopen the file to verify successful encryption.</li>
</ol>
<div class="warn">If you cannot reopen the file, confirm passphrase correctness and that the iteration count and page size are set as intended.</div>
<p class="muted">More help: <a href="/open-encrypted-db.html">Open an encrypted DB</a> • <a href="/wrong-key-errors.html">Fix “wrong key”</a> • <a href="/troubleshooting.html">Troubleshooting hub</a>.</p>
</section>
<!-- Rekey -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Change passphrase (rekey)</h2>
<p class="muted">Rekeying rotates the passphrase and derives new keys. Schedule this for routine credential hygiene and after potential exposure. Back up before you begin.</p>
<ol class="list" style="list-style:decimal">
<li>Open the encrypted database and provide the current passphrase.</li>
<li>Run the <em>Change Passphrase/Rekey</em> action.</li>
<li>Enter and confirm the new passphrase.</li>
<li>Reopen the database to validate the change.</li>
</ol>
<div class="tip">After rekeying, verify that other environments (apps, services) are updated with the new credentials.</div>
</section>
<!-- Decrypt to plain copy -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Decrypt to a plain SQLite copy</h2>
<p class="muted">For interoperability or temporary processing, you may need a non‑encrypted copy. Export a plain copy and handle it with extra care.</p>
<ol class="list" style="list-style:decimal">
<li>Open the encrypted database with the correct passphrase.</li>
<li>Use the <em>Export/Save As (plain)</em> workflow to produce an unencrypted file.</li>
<li>Verify the output by reopening the plain copy.</li>
</ol>
<div class="warn">Plain copies must be protected. Store them securely, scrub sensitive data when possible, and remove temporary files after use.</div>
</section>
<!-- Next steps -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Next steps</h2>
<div class="grid-2">
<div>
<ul class="muted" style="padding-left:18px;margin:8px 0 0">
<li><a href="/open-encrypted-db.html">Open an encrypted database</a></li>
<li><a href="/wrong-key-errors.html">Fix “wrong key” and open errors</a></li>
<li><a href="/csv-import-export.html">Import & export CSV</a></li>
</ul>
</div>
<div>
<ul class="muted" style="padding-left:18px;margin:8px 0 0">
<li><a href="/migrate-to-sqlcipher.html">Migrate existing projects to SQLCipher</a></li>
<li><a href="/best-practices-security.html">Security best practices</a></li>
<li><a href="/download.html">Get the portable build</a></li>
</ul>
</div>
</div>
</section>
<div style="margin-top:18px;display:flex;gap:12px;align-items:center;flex-wrap:wrap">
<div class="muted">Page last modified: <span id="lastModified" class="muted">--</span></div>
<div class="muted">|</div>
<div class="muted">Canonical: <a href="https://db-browser.github.io/encrypt-decrypt-sqlcipher.html">https://db-browser.github.io/encrypt-decrypt-sqlcipher.html</a></div>
</div>
</main>
<footer>
<div class="wrap footer-grid">
<div class="muted">© Community • Unofficial resource • <a href="https://github.com/sqlitebrowser/sqlitebrowser">Source</a></div>
<div style="margin-left:auto" class="muted">
<a href="/changelog.html">Changelog</a> •
<a href="/contact.html">Contact</a> •
<a href="#" onclick="openConsent()">Cookie settings</a> •
<a href="/privacy.html">Privacy</a> •
<a href="/terms.html">Terms</a>
</div>
</div>
</footer>
<!-- Cookie banner (consent) -->
<div id="cookieBanner" class="cookie-banner" role="dialog" aria-live="polite" style="display:none;position:fixed;left:16px;right:16px;bottom:16px;background:linear-gradient(180deg,#fffefe,#f7fbff);padding:12px;border-radius:12px;box-shadow:0 10px 30px rgba(11,99,165,0.08);display:flex;align-items:center;gap:12px;z-index:999">
<div style="display:flex;align-items:center;gap:12px">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="var(--accent)"><use href="#icon-logo"></use></svg>
</div>
<div class="cookie-text" style="flex:1">
<strong>We use analytics</strong>
<div class="muted">This site uses Google Analytics (GA4). You can accept or decline analytics cookies at any time in cookie settings.</div>
</div>
<div style="display:flex;gap:8px">
<button class="btn" id="acceptCookies">Accept</button>
<button class="btn secondary" id="declineCookies">Decline</button>
<button class="btn secondary" id="closeBanner" aria-label="Close cookie banner">Close</button>
</div>
</div>
<!-- Inline JS: consent + small helpers -->
<script>
// Consent helpers
const CONSENT_KEY = 'dbbrowser_consent_v2';
function setConsent(val){ try{localStorage.setItem(CONSENT_KEY,val)}catch(e){} }
function getConsent(){ try{return localStorage.getItem(CONSENT_KEY)}catch(e){return null} }
function showBanner(){document.getElementById('cookieBanner').style.display='flex'}
function hideBanner(){document.getElementById('cookieBanner').style.display='none'}
document.getElementById('acceptCookies').addEventListener('click',function(){ setConsent('accepted'); try{ gtag('consent','update', { 'analytics_storage': 'granted' }); }catch(e){} hideBanner(); });
document.getElementById('declineCookies').addEventListener('click',function(){ setConsent('declined'); try{ gtag('consent','update', { 'analytics_storage': 'denied','ad_storage':'denied','ad_user_data':'denied','ad_personalization':'denied' }); }catch(e){} hideBanner(); });
document.getElementById('closeBanner').addEventListener('click',function(){ setConsent('closed'); hideBanner(); });
function openConsent(){ showBanner(); }
// Last-modified + consent boot
window.addEventListener('load',function(){
var lm = document.lastModified || new Date().toISOString();
var meta = document.querySelector('meta[name="last-modified"]'); if(meta) meta.setAttribute('content', lm);
var el = document.getElementById('lastModified'); if(el) el.textContent = lm;
const consent = getConsent();
if(!consent){ showBanner(); }
if(consent === 'accepted'){
try{ gtag('consent','update', { 'analytics_storage': 'granted' }); }catch(e){}
}
});
</script>
</body>
</html>