-
-
Notifications
You must be signed in to change notification settings - Fork 322
Secure Vault
Secure Vault is a feature in the Harden System Security app that lets you create portable encrypted vaults anywhere you choose in order to store secrets and safely access them whenever you want. At the moment, it only supports TOTP (Time-based One-Time Password) secrets, but it will be expanded in the near future to support more types of secrets. TOTPs are tokens that you receive from websites or services when you enable two-factor authentication.
Secure Vault uses authenticated encryption, strong password-based key derivation, and a layered key hierarchy to protect vault contents.
The vault uses AES-256-GCM (Advanced Encryption Standard with a 256-bit key in Galois/Counter Mode) for encryption and authentication. AES-GCM protects both confidentiality and integrity, which means encrypted vault data cannot be read or modified without detection. The implementation uses a 96-bit AES-GCM nonce and a 128-bit AES-GCM authentication tag.
The vault password is not used directly to encrypt TOTP secrets. Instead, the password is processed with PBKDF2-HMAC-SHA3-512 (Password-Based Key Derivation Function 2 using Hash-based Message Authentication Code with Secure Hash Algorithm 3 with a 512-bit digest) using 1,000,000 iterations and a 256-bit random salt. This produces password-derived key material used to protect the vault's internal key material.
Secure Vault generates a random 256-bit vault data key for the vault. This vault data key is protected using AES-256-GCM with key material derived from the user's password. The encrypted vault data key is stored in the vault file alongside the password KDF (Key Derivation Function) parameters required to unlock it.
Token records are encrypted with a separate record encryption key derived from the vault data key using HKDF-SHA3-512 (HMAC-based Key Derivation Function using SHA3-512). This creates a clear cryptographic hierarchy:
- The user password derives password-based key material.
- The password-derived key material unlocks the vault data key.
- The vault data key derives the record encryption key.
- The record encryption key protects the encrypted TOTP records.
Each TOTP record is encrypted independently with AES-256-GCM. A record contains the token metadata, TOTP algorithm, digit count, period, secret bytes, and notes. Each encrypted record has its own AES-GCM nonce, authentication tag, and ciphertext, so records are protected as separate authenticated payloads inside the same vault.
Secure Vault uses AAD (Additional Authenticated Data) with AES-GCM to bind encrypted data to vault-specific metadata. AAD is authenticated but not encrypted. This means vault context can become part of the authentication boundary without becoming part of the ciphertext itself. If that authenticated context changes, AES-GCM verification fails and the encrypted data is rejected.
The AAD is built from structured vault context and hashed with SHA3-512 before being supplied to AES-GCM. Separate AAD domains are used for vault key wrapping and token record encryption, keeping each cryptographic operation scoped to its intended purpose and preventing encrypted components from being replayed or interpreted in the wrong cryptographic context.
The vault is stored as a JSON envelope and uses the following cryptographic parameters:
| Component | Algorithm or value |
|---|---|
| Vault encryption | AES-256-GCM |
| Password key derivation | PBKDF2-HMAC-SHA3-512 |
| Password KDF iterations | 1,000,000 |
| Password KDF salt size | 256-bit |
| Vault data key size | 256-bit |
| Record key derivation | HKDF-SHA3-512 |
| AES-GCM AAD hashing | SHA3-512 |
| AES-GCM nonce size | 96-bit |
| AES-GCM authentication tag size | 128-bit |
| Vault format version | 1 |
For TOTP generation, Secure Vault supports the standard HMAC-based algorithms:
| TOTP algorithm | Hash function |
|---|---|
| SHA1 (Secure Hash Algorithm 1) | HMAC-SHA1 |
| SHA256 (Secure Hash Algorithm 2 with a 256-bit digest) | HMAC-SHA256 |
| SHA512 (Secure Hash Algorithm 2 with a 512-bit digest) | HMAC-SHA512 |
Supported TOTP code lengths are 6, 7, and 8 digits. The default manual-entry profile is HMAC-SHA1, 6 digits, and a 30-second period.
Secure Vault does not leave its most sensitive runtime material exposed in ordinary plaintext memory while the vault is unlocked. After the vault is opened, the vault data key and stored TOTP secret material are placed under an additional in-memory protection layer using Windows protected memory.
This protection uses CryptProtectMemory with CRYPTPROTECTMEMORY_SAME_PROCESS scope. In this mode, protected memory is encrypted so that it can only be decrypted by the same process that protected it. The protected memory is not designed for long-term storage and is not a replacement for the vault's file encryption. It is a runtime hardening layer for sensitive data that must temporarily exist while the app is active.
The vault data key is protected in memory after the vault is unlocked. When Secure Vault needs to load records, save records, derive record keys, or perform a vault operation that requires the data key, the key is briefly unprotected, used for the required cryptographic operation, and then protected again. This keeps the vault's root runtime secret sealed by default instead of leaving it constantly exposed for the full unlocked session.
Each TOTP secret is also held in protected memory while the vault is unlocked. The secret is unprotected only at the moment Secure Vault needs to generate a code, compare secrets, copy secret bytes for an internal operation, or export decrypted data after explicit confirmation. As soon as the operation completes, the secret is protected again.
This creates a tactical runtime posture:
- The encrypted vault file protects secrets at rest.
- The vault data key unlocks the encrypted vault records only after the correct password is supplied.
- The vault data key is then protected in memory while the vault remains unlocked.
- Each TOTP secret is also protected in memory between active use windows.
- Sensitive buffers are cleared when tokens are removed, the vault is locked, the page unloads, or temporary cryptographic material is no longer needed.
Runtime memory protection is a defensive hardening layer, not a claim of absolute memory invisibility. Any secret that must be used by software must exist in plaintext briefly at the point of use. Secure Vault's strategy is to keep those windows narrow, controlled, and purpose-bound: unseal only when needed, execute the mission, reseal immediately, and burn temporary material after contact.
When no vault exists yet, Secure Vault opens in the Create or import a vault state. The main vault workspace remains visually locked, and the creation card becomes the primary interaction surface. This keeps the user focused on establishing the vault boundary before any secrets can be added or viewed.
The create flow presents two password controls:
- New vault password
- Confirm new vault password
Both fields are required. The vault is created only when the two password values match exactly and the password satisfies the required strength rules.
A password strength indicator is shown above the password fields. It gives immediate feedback while the user types, helping them understand whether the password is ready to protect the vault. The password must include:
- At least 6 characters
- At least one lowercase letter
- At least one uppercase letter
- At least one number
Spaces and symbols are treated as strength bonuses. They are not required, but they improve the displayed strength score.
Important
Even though the minimum required password length is 6, it is strongly recommended to use a longer password for better security. A longer password increases the time and effort required for brute-force attacks.
The create card also includes an Import vault action. This gives users a direct recovery path when they already have an existing encrypted vault file. You can import a vault from any location on your device. The imported vault must be in the correct JSON format and must've been previously created by the Harden System Security app. After selecting the vault file, you will be prompted to enter the vault password to unlock it.
Tip
Secure Vault can also be used with cloud synchronization by placing the vault file inside a OneDrive-backed folder. Once the vault location is changed to OneDrive, Harden System Security saves all vault updates directly to that location, allowing OneDrive to synchronize the encrypted vault file across your devices.
After a vault is created or unlocked, Secure Vault transitions into the main vault workspace. Token creation is available through two primary entry modes:
-
Paste mode lets the user add one or more
otpauth://totp/entries directly from authenticator setup links. - Manual mode lets the user create a token by entering the secret and related account details manually.
A search box allows tokens to be filtered quickly by their visible name or notes. This keeps large vaults usable without forcing the user to visually scan every stored entry.
Each token appears as an individual card. A token card presents the current code, the remaining time before rotation, and the core actions for that token. The user can copy the active code, manage notes, or remove the token from the vault.
Notes provide an optional place to store context for a token, such as account purpose, recovery hints, or environment details. Notes can be added, edited, previewed, or cleared from the token card controls.
Vault-level actions are grouped separately from token-level actions. These controls include locking the vault, changing the vault password, changing the vault location, enabling or disabling auto-lock, clearing all tokens, and exporting decrypted vault contents when explicitly requested.
Important
Destructive and sensitive actions are intentionally gated. Operations such as deleting the vault, clearing all tokens, removing a token, or exporting decrypted data require a hold-to-confirm interaction. This prevents accidental activation and makes high-impact actions deliberate.
Auto-lock provides an additional safety layer by returning the vault to the locked state after inactivity. When the vault locks, the workspace becomes inaccessible until the correct vault password is entered again.
Together, these controls keep the interface direct and operationally focused: unlock the vault, find the token, use the code, manage secrets when needed, and lock the vault when finished.
You can enable side-channel isolation mitigations in the Secure Vault page by toggling its option. The mitigations are only applied early during app startup sequence so in order for your changes to take effect, you need to restart the app after enabling/disabling that option.
They control mitigation behaviors related to side-channel attack surfaces, including speculative execution behavior and page combining.
| Mitigation | Technical behavior |
|---|---|
| SMT branch target isolation | Requests hardware mitigations that prevent cross-SMT-thread branch target pollution while the process is executing in user mode. If the hardware does not support the mitigation, or if the mitigation is disabled system-wide, this setting has no effect. |
| Isolate security domain | Isolates the process into a distinct security domain, even from other processes running under the same security context. This prevents cross-process branch target injection. It also limits page combining to processes within the same security domain, effectively restricting combining to the process itself except for common pages, unless page combining is further restricted. |
| Disable page combine | Disables page combining for the process, including internal page combining within the process itself, except for common pages such as pages made entirely of zeroes or entirely of ones. |
| Speculative store bypass disable | Requests hardware mitigation for Speculative Store Bypass while the process is executing in user mode. This is used to mitigate intra-process Speculative Store Bypass exposure. If the hardware does not support the mitigation, or if the mitigation is disabled system-wide, this setting has no effect. |
| Restrict core sharing | Requests scheduler isolation so threads in the process are not scheduled on the same physical core as threads from another security domain. This policy cannot be enabled on systems where the scheduler cannot provide that guarantee, such as certain virtual machine environments unless the hypervisor reports the absence of non-architectural core sharing. |
These options are designed for high-isolation workloads where the process should reduce exposure to cross-thread, cross-process, or cross-security-domain side-channel vectors. Keep in mind that enabling these mitigations may have performance implications, so they should be used based on the specific security requirements of your environment.
- Create AppControl Policy
- Create Supplemental Policy
- System Information
- Configure Policy Rule Options
- Policy Editor
- Simulation
- Allow New Apps
- Build New Certificate
- Create Policy From Event Logs
- Create Policy From MDE Advanced Hunting
- Create Deny Policy
- Merge App Control Policies
- Deploy App Control Policy
- Get Code Integrity Hashes
- Get Secure Policy Settings
- Update
- Sidebar
- Validate Policies
- View File Certificates
- Microsoft Graph
- Firewall Sentinel
- Data Analysis in AppControl Manager
- Compare Policies
- Protect
- Microsoft Security Baselines
- Microsoft Security Baselines Overrides
- Microsoft 365 Apps Security Baseline
- Microsoft Defender
- Attack Surface Reduction
- Bitlocker
- Device Guard
- TLS Security
- Lock Screen
- User Account Control
- Windows Firewall
- Optional Windows Features
- Windows Networking
- Miscellaneous Configurations
- Windows Update
- Edge Browser
- Certificate Checking
- Country IP Blocking
- Non Admin Measures
- Group Policy Editor
- Manage Installed Apps
- File Reputation
- Audit Policies
- Cryptographic Bill of Materials
- Intune
- Configuration Service Provider (CSP)
- Service Manager
- Exploit Mitigations
- Sandbox Maker
- WinGet Management
- Secure Vault
- Duplicate Photos Finder
- EXIF Manager
- Download Manager
- Bootable Drive Maker
- Introduction
- How To Generate Audit Logs via App Control Policies
- How To Create an App Control Supplemental Policy
- The Strength of Signed App Control Policies
- How To Upload App Control Policies To Intune Using AppControl Manager
- How To Create and Maintain Strict Kernel‐Mode App Control Policy
- How to Create an App Control Deny Policy
- App Control Notes
- How to use Windows Server to Create App Control Code Signing Certificate
- Fast and Automatic Microsoft Recommended Driver Block Rules updates
- App Control policy for BYOVD Kernel mode only protection
- EKUs in App Control for Business Policies
- App Control Rule Levels Comparison and Guide
- Script Enforcement and PowerShell Constrained Language Mode in App Control Policies
- How to Use Microsoft Defender for Endpoint Advanced Hunting With App Control
- App Control Frequently Asked Questions (FAQs)
- System Integrity Policy Transformations | XML to CIP and Back
- About Code Integrity Policy Signing
- How To Install Microsoft Store Apps Completely Offline
- Create Bootable USB flash drive with no 3rd party tools
- Event Viewer
- Group Policy
- How to compact your OS and free up extra space
- Hyper V
- Git GitHub Desktop and Mandatory ASLR
- Signed and Verified commits with GitHub desktop
- About TLS, DNS, Encryption and OPSEC concepts
- Things to do when clean installing Windows
- Comparison of security benchmarks
- BitLocker, TPM and Pluton | What Are They and How Do They Work
- How to Detect Changes in User and Local Machine Certificate Stores in Real Time Using PowerShell
- Cloning Personal and Enterprise Repositories Using GitHub Desktop
- Only a Small Portion of The Windows OS Security Apparatus
- Rethinking Trust: Advanced Security Measures for High‐Stakes Systems
- Clean Source principle, Azure and Privileged Access Workstations
- How to Securely Connect to Azure VMs and Use RDP
- Basic PowerShell tricks and notes
- Basic PowerShell tricks and notes Part 2
- Basic PowerShell tricks and notes Part 3
- Basic PowerShell tricks and notes Part 4
- Basic PowerShell tricks and notes Part 5
- How To Access All Stream Outputs From Thread Jobs In PowerShell In Real Time
- PowerShell Best Practices To Follow When Coding
- How To Asynchronously Access All Stream Outputs From Background Jobs In PowerShell
- Powershell Dynamic Parameters and How to Add Them to the Get‐Help Syntax
- RunSpaces In PowerShell
- How To Use Reflection And Prevent Using Internal & Private C# Methods in PowerShell