1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! # IntelliWallet Core
//!
//! A secure password manager library with authenticated encryption
//! (XChaCha20-Poly1305 + Argon2id).
//!
//! This is the storage and cryptography engine behind
//! [IntelliWallet](https://intelliwallet.io/).
//!
//! ## Features
//!
//! - Authenticated encryption: XChaCha20-Poly1305 over a per-vault Data
//! Encryption Key, wrapped by an Argon2id-derived key
//! - Transparent, crash-safe migration of older vaults on first unlock
//! - SQLite database storage
//! - Hierarchical item organization (folders)
//! - Custom field types and labels
//! - Backup and restore functionality
//! - Multi-language support (11 languages)
//!
//! ## Example
//!
//! ```no_run
//! use iwcore::Wallet;
//! use std::path::Path;
//!
//! let mut wallet = Wallet::open(Path::new("/path/to/wallet")).unwrap();
//! wallet.unlock("my_password").unwrap();
//!
//! let items = wallet.get_items().unwrap();
//! for item in items {
//! println!("{}: {}", item.item_id, item.name);
//! }
//! ```
// Re-export main types
pub use ;
pub use ;
pub use Wallet;
pub use ;
pub use Translations;
pub use ;
pub use ;
pub use DatabaseStats;
/// Database version constant.
///
/// Version 6 = schema 5 plus the v6 crypto scheme (XChaCha20-Poly1305 over a
/// per-vault DEK wrapped by Argon2id). Password-free schema migrations on
/// `open()` only reach version 5 (see `migrations::CURRENT_VERSION`); the bump
/// to 6 happens inside `unlock()` after the one-time crypto re-encryption.
pub const DB_VERSION: &str = "6";
/// Root item ID
pub const ROOT_ID: &str = "__ROOT__";
/// Root parent ID placeholder
pub const ROOT_PARENT_ID: &str = "________";
/// Default encryption iteration count
pub const ENCRYPTION_COUNT_DEFAULT: u32 = 200;
/// Item ID length
pub const ITEM_ID_LENGTH: usize = 8;
/// Field ID length
pub const FIELD_ID_LENGTH: usize = 4;
/// Label ID length
pub const LABEL_ID_LENGTH: usize = 4;
/// Database filename
pub const DATABASE_FILENAME: &str = "nswallet.dat";
/// Minimum password length
pub const PASSWORD_MIN_LENGTH: usize = 3;
/// Maximum password length
pub const PASSWORD_MAX_LENGTH: usize = 32;
/// Minimum search phrase length
pub const SEARCH_MIN_LENGTH: usize = 2;