Skip to main content

Overview

The LabTech agent stores sensitive values — server password, agent password, proxy credentials — in the registry as Base64-encoded strings encrypted with Triple DES. Two functions expose this codec: Both functions use a default key ("Thank you for using LabTech.") when no key is provided. For agent-specific values such as proxy credentials, the agent password is used as the key instead.

Decoding a value — ConvertFrom-LTSecurity

Basic decode (default key)

Decode using the server password as the key

Proxy credentials in HKLM:\SOFTWARE\LabTech\Service\Settings are encoded with the agent password, which is itself encoded with the server password. Read the server password first, then use it as the key:

Pipeline usage

-InputString accepts pipeline input by value and by property name:

The -Force fallback

By default -Force is $True. When the primary decode attempt fails (wrong key, corrupted data), the function automatically retries:
  • If no key was passed: retries with an empty string key.
  • If a key was passed: retries using the default key.
Set -Force:$False to disable the fallback and receive $Null on failure instead:

Encoding a value — ConvertTo-LTSecurity

Basic encode (default key)

Encode with a specific key

Proxy credentials must be encoded with the agent password before writing to the registry:
These encoded values can then be passed to Set-LTProxy:

Encode multiple values via pipeline

Real-world example: reading registry credentials

This pattern reads the server password directly from the installed agent registry and decodes it for use in a script:
Decoded passwords are plain text in memory. Avoid writing them to disk or logging them. Use -Force:$False and $SecureString handling where possible to minimize exposure.

How the codec works

Internally, both functions use System.Security.Cryptography.TripleDESCryptoServiceProvider with:
  • Key: MD5 hash of the UTF-8 encoded key string
  • IV: [byte[]](240, 3, 45, 29, 0, 76, 173, 59)
  • Encoding: UTF-8 for the plaintext; Base64 for the ciphertext
The default key is "Thank you for using LabTech.". Agent-specific values use a per-agent password derived from the server password as the key, so encoded values are not portable across agents or server reinstalls.