zoukankan      html  css  js  c++  java
  • 对SQLite3数据库的一些加密解密函数

     function SQLite3_Open_UTF8(const filename:PAnsiChar; var dbHandle: Pointer ):integer;  cdecl;
             external 'sqlite3.dll' name 'sqlite3_open';
      function SQLite3_Open_UTF16(const filename:PAnsiChar;var dbHandle:Pointer):Integer;cdecl;
               external 'sqlite3.dll' name 'sqlite3_open16';
      function SQLite3_Close(dbHandle:pointer):integer;cdecl; external 'sqlite3.dll'
               name 'sqlite3_close';
    
      function SQLite3_Key(dbHandle:Pointer; Key:PAnsiChar; keyLen:integer ):integer;cdecl;
               external 'sqlite3.dll' name 'sqlite3_key';
      function SQLite3_ReKey(dbHandle:Pointer; Key:PAnsiChar; KeyLen:integer):integer;cdecl;
               external 'sqlite3.dll' name 'sqlite3_rekey';

    具体的其它函数可以看下wxsqlite3(开源)附带的说明。

    以上函数说明:

           如果数据库没有密码,现在要设置:先open数据库,再用SQLite3_ReKey设置密码;
           如果数据库有密码,现在要修改密码,则先open数据库,再用SQLite3_Key输入原来的密码
             ,再用rekey设置新密码。
          如果想把加密后的数据库变成没有加密的,则先open数据库,再用SQLite3_Key输入原来的密
          码,再用SQLite3_ReKey(pdb,nil,0)即可。
          最后用SQLite3_Close(pdb)关闭即可

  • 相关阅读:
    web页面性能优化之接口前置
    python大佬养成计划----flask_bootstrap装饰网页
    撸个查询物流的小程序,欢迎体验
    FullCalendar插件的基本使用
    GeekforGeeks Trie
    使用Django和Python创建Json response
    nginx-gridfs的安装
    Linux kernel config and makefile system
    hadoop日志分析
    安装STS报错(三)
  • 原文地址:https://www.cnblogs.com/yagzh2000/p/2865944.html
Copyright © 2011-2022 走看看