尝试过
- https://pkg.go.dev/github.com/mutecomm/go-sqlcipher#section-readme
- https://stackoverflow.com/questions/66818643/does-gorm-support-working-with-encrypted-sqlite-db
- https://github.com/mutecomm/go-sqlcipher
都失败了
打开 db 代码如下:
dbname := `***.db`
key := "dd85344"
dbnameWithDSN := dbname + fmt.Sprintf("?_pragma_key=%s&_pragma_cipher_page_size=4096", key)
db, err := gorm.Open(sqlite.Open(dbnameWithDSN), &gorm.Config{})
也尝试过\
dbname := `***.db`
key := "dd85344"
dbnameWithDSN := dbname + fmt.Sprintf("?_pragma_key=%s&_pragma_cipher_page_size=4096", key)
db, _ := sql.Open("sqlite3", dbname)
密码肯定是对的,不过我这边的 key 是 7 位的,官方说的是必须为 32 字节十六进制编码
我觉得问题应该出现在这,但是我不知道该怎么下一步转换了