Closed claustrofob closed 2 years ago
Hey, we have same problem https://github.com/sqlcipher/sqlcipher/issues/412
Strange, that's an error from SQLite. Do you know if it works without SQLite.swift
?
I did not check if it works without SQLite.swift
. But SQLite.swift
definitely works without using key
and rekey
methods.
I am having this issue as well.
SQLCipher - 4.4.3 SQLite.swift/SQLCipher - 0.13.0
How much time do we have to patch this before 15.2 release?
As commented on sqlcipher/sqlcipher#412, it looks like there's a conflict between the bundled version of SQLite and SQLCipher.
Tested vanilla SQLCipher v. 4.5.0 with sqlite3_key
and sqlite3_rekey
. No issues, works good.
@claustrofob can you post your Podfile?
@jberkel
pod 'SQLite.swift', '~> 0.13.0'
pod 'SQLite.swift/SQLCipher', '~> 0.13.0'
but I've got my mistake. It must be just subspec:
pod 'SQLite.swift/SQLCipher', '~> 0.13.0'
Now it works. The docs are a bit misleading for me here. Thank you.
I'm sorry but it's still not working for me even after the subspec:
- SQLCipher (4.5.0):
- SQLCipher/standard (= 4.5.0)
- SQLCipher/common (4.5.0)
- SQLCipher/standard (4.5.0):
- SQLCipher/common
- SQLite.swift (0.13.1):
- SQLite.swift/standard (= 0.13.1)
- SQLite.swift/SQLCipher (0.13.1):
- SQLCipher (>= 4.0.0)
- SQLite.swift/standard (0.13.1)
- SQLiteMigrationManager.swift (0.7.0):
- SQLite.swift (~> 0.13.0)
Ok it appears that I have resolved it. SQLiteMigrationManager depends upon non-cipher so I had to fork the repo and change the Podspec dependency. Is this resolvable automatically with CocoaPods somehow? Should I open an Issue on SQLiteMigrationManager repo?
Vanilla SQLiteMigrationManager 0.8.0
- SQLCipher (4.5.0):
- SQLCipher/standard (= 4.5.0)
- SQLCipher/common (4.5.0)
- SQLCipher/standard (4.5.0):
- SQLCipher/common
- SQLite.swift (0.13.1):
- SQLite.swift/standard (= 0.13.1)
- SQLite.swift/SQLCipher (0.13.1):
- SQLCipher (>= 4.0.0)
- SQLite.swift/standard (0.13.1)
- SQLiteMigrationManager.swift (0.8.0):
- SQLite.swift (~> 0.13.0)
Forked Repository SQLiteMigrationManager 0.8.0 /w SQLCipher podspec dependency
- SQLCipher (4.5.0):
- SQLCipher/standard (= 4.5.0)
- SQLCipher/common (4.5.0)
- SQLCipher/standard (4.5.0):
- SQLCipher/common
- SQLite.swift/SQLCipher (0.13.1):
- SQLCipher (>= 4.0.0)
- SQLiteMigrationManager.swift (0.8.0):
- SQLite.swift/SQLCipher (~> 0.13.0)
@nitrag I'm not sure what the best solution here is. Perhaps SQLiteMigrationManager
could have a subspec which depends on SQLite.swift/SQLCipher
(open an issue/ask over there). Or you could do some trickery in pre_install
, to remove the dependency there.
Seems like there is an incompatibility between SQLite.swift
and SQLite.swift/SQLCipher
.
The db encrypted with some key when both specs enabled:
pod 'SQLite.swift', '~> 0.13.0'
pod 'SQLite.swift/SQLCipher', '~> 0.13.0'
cannot be decrypted with the same key when only subspec is enabled:
pod 'SQLite.swift/SQLCipher', '~> 0.13.0'
This is a serious problem:
Is there any workaround for this?
@claustrofob please see #1098. Maybe the db wasn't encrypted correctly, the documentation is misleading.
This is a serious problem:
You're using an unsupported configuration (2 specs enabled), don't blame the library for not functioning.
@jberkel sure i dont blame the library, that was my mistake. But i guess it might affect other users of the library. So i need to recover from this state somehow.
i would appreciate any idea.
Sorry, this is not directly related to SQLite.swift, and it sounds like you might have misused SQLite.swift and/or SQLCipher. Closing this.
When trying to encrypt non encrypted db or change the key on an open encrypted db with
Connection.rekey
or decrypt the encrypted db withConnection.key
it throws "bad parameter or other API misuse (code: 21)".On iOS 15.1 and earlier the same code works fine. Tested on different devices.
SQLite v. 0.13.0 SQLite.swift/SQLCipher v. 0.13.0 SQLCipher 4.4.3, 4.5.0