2.6. Key Localization Algorithm
2.6. Key Localization Algorithm
A localized key is a secret key shared between a user U and one authoritative SNMP engine E. Even though a user may have only one password and therefore one key for the whole network, the actual secrets shared between the user and each authoritative SNMP engine will be different. This is achieved by key localization.
Purpose of Key Localization
Key localization provides several important security benefits:
-
Unique Keys per Engine: Each authoritative SNMP engine has a unique localized key for each user, even if the user uses the same password everywhere.
-
Limited Key Compromise Impact: If a localized key is compromised on one engine, it does not compromise the user's keys on other engines.
-
Engine-Specific Protection: The keys are cryptographically bound to the specific engine's identity (snmpEngineID).
Key Localization Process
The key localization process converts a user's key Ku (derived from their password) into a localized key Kul specific to an authoritative SNMP engine E.
Step 1: Password to Key Conversion
First, if a user uses a password, the user's password is converted into a key Ku using one of the two algorithms described in Appendices A.2.1 and A.2.2:
- For MD5-based authentication: Use the password-to-key algorithm in Appendix A.2.1
- For SHA-based authentication: Use the password-to-key algorithm in Appendix A.2.2
This produces a user key Ku that is independent of any specific SNMP engine.
Step 2: Key Localization
To convert key Ku into a localized key Kul of user U at the authoritative SNMP engine E, the following algorithm is used:
-
Append snmpEngineID to Ku: Take the key Ku and append the snmpEngineID of the authoritative SNMP engine E to it.
-
Append Ku again: Append the key Ku to the result from step 1, thus enveloping the snmpEngineID within two copies of the user's key Ku.
-
Hash the result: Run a secure hash function on the concatenated data. The hash function used depends on the authentication protocol defined for this user U at authoritative SNMP engine E:
- If using HMAC-MD5-96 authentication: Use MD5 hash
- If using HMAC-SHA-96 authentication: Use SHA-1 hash
-
Result is localized key: The output of the hash function is the localized key Kul for user U at authoritative SNMP engine E.
Algorithm Pseudocode
Input:
Ku - User's key (derived from password)
snmpEngineID - Engine's unique identifier
Process:
Kul = Hash(Ku || snmpEngineID || Ku)
Where:
|| - denotes concatenation
Hash - is MD5 for HMAC-MD5-96 or SHA-1 for HMAC-SHA-96
Output:
Kul - Localized key for user U at engine E
Example
Suppose:
- User U has password "myPassword"
- Password is converted to key Ku (using password-to-key algorithm)
- Authoritative engine E has snmpEngineID = 0x80001F8880...
Then:
Kul = MD5(Ku || 0x80001F8880... || Ku)
This Kul is unique to user U on engine E. If the same user accesses a different engine E2 with engineID 0x80001F8881..., a different localized key would be computed:
Kul2 = MD5(Ku || 0x80001F8881... || Ku)
Localized Key Usage
Once computed, localized keys are used for two purposes:
-
Authentication Keys: The localized authentication key (authKey) is derived from Kul and used in HMAC operations for message authentication.
-
Privacy Keys: The localized privacy key (privKey) is derived from Kul and used for encrypting/decrypting message payloads.
The derivation of authKey and privKey from Kul is described in the respective authentication and privacy protocol specifications (Sections 6, 7, and 8).
Key Management Implications
Key Storage
Implementations should store localized keys rather than the original password or user key Ku. This provides better security:
- If the device is compromised, only the localized keys for that device are exposed
- The user's password and keys for other devices remain secure
Key Updates
When a user's password changes:
- A new Ku is computed from the new password
- New localized keys Kul must be computed for all engines the user accesses
- Old localized keys should be securely deleted
Initial Configuration
For initial configuration or key distribution, implementations must either:
- Use the password-to-key and key localization algorithms to compute localized keys from a configured password
- Directly configure pre-computed localized keys (if out-of-band key distribution is used)
Security Considerations
-
One-way Function: Key localization is a one-way function. Given Kul and snmpEngineID, it is computationally infeasible to derive Ku.
-
Engine Identity Binding: The localized key is cryptographically bound to the engine's identity, preventing key reuse across engines.
-
Hash Function Strength: The security of key localization depends on the strength of the hash function (MD5 or SHA-1) used.
References
The key localization concept and algorithm are further detailed in:
- [Localized-key]: "Key Derivation for Network Management Applications", U. Blumenthal, B. Wijnen, K. McCloghrie, Internet Draft (work in progress)
- Password-to-key algorithms: Appendix A.2.1 (MD5) and A.2.2 (SHA) of this RFC