These commands help with URL-safe string handling and password-hash operations inside the script engine.
Use UrlEncode and UrlDecode for transport-safe text, CryptMd5 when a target system expects a crypt-style MD5 hash, and the comparison commands when you need to verify a supplied password against a stored salted hash.
{
"UrlEncode": {
"Source": "http://some.test.org/query?var1=value1&var2=value2 &var3=passé",
"ResultVariable": "EncodedUrl",
"IsSecret": false
}
}
{
"UrlDecode": {
"Source": "%EncodedUrl%",
"ResultVariable": "DecodedUrl",
"IsSecret": false
}
}| Name | Type | Required? | Description |
|---|---|---|---|
Source |
String expression | Yes | Text to encode or decode. |
ResultVariable |
String | Yes | Variable that receives the converted text. |
IsSecret |
Boolean | No | Masks the stored result in logs. Default is false. |
{
"CryptMd5": {
"Source": "%NewPassword%",
"ResultVariable": "NewPass"
}
}| Name | Type | Required? | Description |
|---|---|---|---|
Source |
String expression | Yes | Plaintext value to hash. |
ResultVariable |
String | Yes | Variable that receives the generated hash. |
The following commands share the same interface:
CompareShadowHashComparePasswordHashCompareMacOsPasswordHashCompareUnixPasswordHash
{
"CompareShadowHash": {
"Password": "%AccountPassword%",
"SaltedHash": "%AccountEntry%",
"ResultVariable": "PasswordHashMatched"
}
}| Name | Type | Required? | Description |
|---|---|---|---|
Password |
Secret expression | Yes | Plaintext password to test. |
SaltedHash |
String expression | Yes | Stored salted hash or platform-specific hash text. |
ResultVariable |
String | No | Variable that receives the boolean match result. |
| Command | Target format |
|---|---|
CompareShadowHash |
Linux /etc/shadow-style entries |
ComparePasswordHash |
General salted-hash comparison |
CompareMacOsPasswordHash |
macOS directory-service shadow hash data |
CompareUnixPasswordHash |
General Unix password hash formats |
Pattern based on the script-engine URL encode/decode tests:
{
"UrlEncode": {
"Source": "http://some.test.org/query?var1=value1&var2=value2 &var3=passé",
"ResultVariable": "EncodedUrl"
}
}
{
"UrlDecode": {
"Source": "%EncodedUrl%",
"ResultVariable": "DecodedUrl"
}
}From the built-in System/Imports/CheckpointSshFunctions.json definition:
{
"CryptMd5": {
"Source": "%NewPassword%",
"ResultVariable": "NewPass"
}
}From samples/ssh/generic-linux/GenericLinux.json:
{
"CompareShadowHash": {
"Password": "%AccountPassword%",
"SaltedHash": "%AccountEntry%",
"ResultVariable": "PasswordHashMatched"
}
}From samples/ssh/linux-ssh-batch-mode/LinuxSshBatchModeExample.json:
{
"ComparePasswordHash": {
"Password": "%AccountPassword%",
"SaltedHash": "%Entry%",
"ResultVariable": "PasswordHashMatched"
}
}From the built-in System/MacOsSsh.json platform definition:
{
"CompareMacOsPasswordHash": {
"Password": "%AccountPassword%",
"SaltedHash": "%PasswordHash%",
"ResultVariable": "PasswordHashMatched"
}
}
UrlEncodeandUrlDecodeexpect string input. A missing or nullSourceresults in an error.
The comparison commands write a boolean into
ResultVariableand also return that boolean as the command result.
CompareUnixPasswordHashuses the same parameter shape shown above even though this repository does not currently ship a public sample script that calls it directly.