Proposal: SecureStore
Class for Cross-Platform Secure Storage in U++
#265
Replies: 5 comments 7 replies
-
Sounds good... |
Beta Was this translation helpful? Give feedback.
-
Ok, I have uploaded the prototype here Notes:
|
Beta Was this translation helpful? Give feedback.
-
This is definitely better, but to change it, you will need to override the class. I think passing this value as parameter is easier and do not require defining new class.
I would stay with IFDEF's. They are better than checking this kind of information on runtime. I think is POSIX and not MACOS and not ANDROID should work as expected. |
Beta Was this translation helpful? Give feedback.
-
I decided to take this matter into my own hands and have proposed AES-256-GCM encryption/decryption support for U++ (#266). In short, if this proposal is accepted:
At that point, we could build a cross-platform keyring using AES-256 and SQLite. |
Beta Was this translation helpful? Give feedback.
-
How about SecureStore , short, CamelCase, and immediately convey ‘put secrets safely.’ , reads naturally alongside Core/SSL, Core/DB, etc. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Many modern applications need to store passwords or OAuth tokens securely across platforms. Currently, there's no unified API in U++ to interact with the system’s native secure credential stores, leaving developers to roll their own implementations — which is error-prone and potentially insecure.
This proposal introduces a
SecretStorage
class that:Provides simple, secure APIs for storing, retrieving, and deleting secrets.
Works across Linux, Windows, and macOS using platform-native facilities.
Supports both simple string passwords and larger binary blobs (e.g. OAuth tokens, serialized settings), up to ~4KB.
Design Plan
Class Name
Platforms & Backends
Linux:
libsecret
Windows: Credential Manager API
macOS: Keychain Services
These are all stable, system-supported facilities designed for secure storage.
Capabilities
For simple secrets (like passwords)
For larger blobs (up to ~4 KB)
Note: Internally,
StoreBlob()
may compress or serialize input to ensure it fits platform limits. All blob inputs are treated as opaque data; caller is responsible for structure/encoding.For error management
Service name (or path)
String service = "org.Upp.SecretStorage"
Platform Notes
Linux:
Uses
libsecret
(via D-Bus and GNOME Keyring or KDE KWallet).Requires
libsecret
andglib
as runtime dependencies.Windows:
Uses
CredWrite
,CredRead
, andCredDelete
(Credential Manager).Data is stored securely per-user.
macOS:
Uses
SecItemAdd
,SecItemCopyMatching
, andSecItemDelete
.Stored in the user’s Keychain, with optional UI prompts.
Scope Limitations
This is a minimalist and secure-by-default utility. It will:
Not support schema definitions (as in full libsecret)
Not support multiple user profiles, UI prompts, or third-party vaults
Not expose raw credential handles or advanced platform-specific settings
Security Traits
Always prefer system-managed storage for security and persistence.
Avoid reinventing crypto: rely on what the platform provides.
Secrets will never be stored in plaintext files or memory beyond necessary scope.
All backends (Credential Manager, Keychain, libsecret) store data encrypted at rest.
Current Status
Beta Was this translation helpful? Give feedback.
All reactions