2

我制作了一个 tkinter 桌面应用程序,并且我有一个以auth单行命名的表,其中包含敏感的 API 凭据。我的想法是使用pysqlcipher( link ) 或等效方法加密此表。

根据文档,您必须PRAGMA key在进行任何操作之前通过。如果有人反编译了我的应用程序的 .exe 版本,他们难道不能在源代码中找到这个密钥,然后从那里解密数据库吗?如果是这样,在桌面应用程序中保护敏感 API 凭据的常见解决方案是什么?

from pysqlcipher import dbapi2 as sqlite
conn = sqlite.connect('test.db')
c = conn.cursor()
c.execute("PRAGMA key='test'")
c.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''')
c.execute("""insert into stocks values ('2006-01-05','BUY','RHAT',100,35.14)""")
conn.commit()
c.close()

我的 sqlite 表结构:

db.sqlite
|__ profiles
|__ auth
|__ tables

免责声明:我不是安全或加密专家,但我非常愿意探索和学习所有选项。

4

0 回答 0