当前位置:网站首页>How to use sqlcipher tool to decrypt encrypted database under Windows system

How to use sqlcipher tool to decrypt encrypted database under Windows system

2022-07-05 09:47:00 Black Mountain demon 2018

window Under the system , How to use sqlcipher The tool decrypts the encrypted database

Demand background

At present, the database in my project is sqlcipher Encrypted , This article describes how to use sqlcipher Tools to decrypt , It has been used by testers and other developers .

Using tools

Tool download address , Extraction code 59jq

Specific decryption operations

1. Unzip the downloaded tool
 Insert picture description here
2. open cmd Command the tool to bin Under the table of contents
 Insert picture description here
3. Decrypt the existing encrypted database , Based on the project universal_encrypt.db For example , perform
sqlcipher-shell64.exe universal_encrypt.db Enter into sqlite in
 Insert picture description here
4. Decrypt the database , Perform the following four operations

     1.PRAGMA key = '123456';
     2.ATTACH DATABASE 'plaintext.db' AS plaintext KEY '';
     3.SELECT sqlcipher_export('plaintext');
     4.DETACH DATABASE plaintext

5. finished decrypting , This plaintext.db Decrypt the database
 Insert picture description here  Insert picture description here

Other uses

1. Create database

 1.sqlcipher-shell64.exe  encrypted .db
 2.PRAGMA key = 'password';
 3.create table encrypted (id integer, name text);
 4. .schema
     CREATE TABLE encrypted (id integer, name text);

2. Encrypt the existing database

 1.sqlcipher-shell64.exe  universal.db
 2.ATTACH DATABASE 'encrypted.db' AS encrypted KEY 'password';
 3.SELECT sqlcipher_export('encrypted');
 4.DETACH DATABASE encrypted;

3. Change Password
1.sqlite> PRAGMA rekey = ‘newPassword’;

4. Open encrypted database

1.sqlcipher-shell64.exe encrypted .db
2.PRAGMA key = ‘password’;
3. .schema

Reference article :
https://blog.csdn.net/wengpanfeng/article/details/78406172

原网站

版权声明
本文为[Black Mountain demon 2018]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140536454217.html