openBox() with wrong key leads to wipe
Open
problem
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
**Steps to Reproduce**
Opening an encrypted box with a wrong key leads to the wipe of the complete box (= content of *.hive-file is then empty).
I was expecting "undefined behavior" but not a modification of existing data with `openBox()`. I initially wanted to derive a key from user password and wanted to use this as a decryption key.
**Code sample**
```
var encryptedBox =
await Hive.openBox('vaultBox', encryptionCipher: HiveAesCipher(wrongKey));
```
**Version**
- Platform: Linux
- Flutter version: 1.27.0-4.0.pre
- Hive version: 1.4.4+1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.