Encrypt and decrypt plain text data only through the LESecure REST API. The API supports layered security "locks" that can be combined for defense-in-depth protection.
ResourceURLSource code & documentationhttps://github.com/SPAlgorithm/LEAPI endpointhttps://api.lesecure.ai/execLocal/on-prem alternativeLESecureLocal skill (no data leaves your machine)
If you cannot verify the LESecure service or its privacy practices, use the LESecureLocal skill instead — it runs entirely on your device with no network calls.
Before running any command in this skill, confirm the following are available. If any is missing, tell the user and stop — do not invent values or fall back silently.
RequirementPurposeHow to checkcurl on PATHMake the HTTPS request to the LESecure APIcommand -v curl``python3 ≥ 3.9 on PATHCompute time-lock windows ( -l, -r) in EST/EDT cross-platform. Requires zoneinfo module (built-in from Python 3.9+).python3 -c "from zoneinfo import ZoneInfo; print('ok')"``LESECURE_API_KEY env varBearer token for the API. Must be set in the shell that runs curl; the skill never places it on the command line and never writes it to disk.[ -n "$LESECURE_API_KEY" ]
No other credentials are read. The skill does not open files, browsers, or any OS keychain.
This skill sends data to a third-party remote endpoint over the network. Users must understand what is transmitted before proceeding.
https://api.lesecure.ai/exec over TLS (HTTPS). See source & docs for the service's privacy practices.https://api.lesecure.ai/execAuthorization header, sourced from $LESECURE_API_KEYapplication/json{"args": [<array of CLI-style arguments>]}The key is a secret. These rules apply to every invocation, no exceptions:
LESECURE_API_KEY environment variable. The skill references $LESECURE_API_KEY inside the curl argument so the shell does the substitution — the literal key is never written on the command line.ps.LESECURE_API_KEY is unset, stop and instruct the user to set it (see the one-time setup below). Do not ask the user to paste the key into chat.export it into the current shell session only, use it for this request, then tell the user to rotate the key (paste-in-chat is a key-exposure event).bash
# Prompt the user interactively; -s hides input, echo after adds a newline
read -rs -p 'LESECURE_API_KEY: ' LESECURE_API_KEY && echo
export LESECURE_API_KEY
To persist across shells (in order of preference):
1Password CLI, aws ssm, doppler, or similar to inject the key at shell startup.export LESECURE_API_KEY='…' to ~/.zshrc / ~/.bashrc (ensure the file is chmod 600)..env file excluded from version control and source it.If the user ever pastes the key into chat, remind them: "Your API key was exposed in chat history. Rotate it immediately at your LESecure dashboard."
All date/time handling for this skill follows these rules — no exceptions, no need for the user to restate them:
Always use EST/EDT (America/New_York) to calculate and send dates. The LESecure server interprets -l and -r in EST/EDT. Never use UTC, never convert.
Start time ( -l) = current EST + 2 minutes by default. This buffer prevents the "date must be in future" error caused by clock drift between the client and server.
End time ( -r) = start time + the user's requested duration (e.g., "for next 10 min" means -r is start + 10 min, so 12 minutes from "now" in absolute terms).
Cross-platform time computation. Use Python 3 because date flag syntax differs between BSD (macOS) and GNU (Linux):
bash
# Start time (now + 2 minutes, EDT/EST)
python3 -c "from datetime import datetime,timedelta; from zoneinfo import ZoneInfo; print((datetime.now(ZoneInfo('America/New_York'))+timedelta(minutes=2)).strftime('%Y/%m/%d %H:%M'))"
# End time (now + 2 min + N minutes)
python3 -c "import sys; from datetime import datetime,timedelta; from zoneinfo import ZoneInfo; N=int(sys.argv[1]); print((datetime.now(ZoneInfo('America/New_York'))+timedelta(minutes=2+N)).strftime('%Y/%m/%d %H:%M'))" <N>
# End time (now + 2 min + N hours)
python3 -c "import sys; from datetime import datetime,timedelta; from zoneinfo import ZoneInfo; N=int(sys.argv[1]); print((datetime.now(ZoneInfo('America/New_York'))+timedelta(minutes=2,hours=N)).strftime('%Y/%m/%d %H:%M'))" <N>
Fallback ( date) — only if python3 is unavailable:
TZ=America/New_York date -v+2M "+%Y/%m/%d %H:%M"TZ=America/New_York date -d '+2 minutes' "+%Y/%m/%d %H:%M"Always display the window back to the user in EDT/EST so they know when they can decrypt.
LESecure supports these lock types, which can be combined freely:
FlagLock TypeValueExample-1Pin/CodeNumeric string"1122"``-wPasswordPassphrase string"mypasscode"``-2MFAPhone number (E.164)"+19199870623"``-lTime lock startDate/time YYYY/MM/DD HH:MM``"2026/04/12 17:41"``-rTime lock endDate/time YYYY/MM/DD HH:MM``"2027/04/12 17:36"
Time locks ( -l and -r) are used together to define an access window during which decryption is allowed.
-e)#Use -e followed by the data to encrypt.
-d)#Use -d followed by the encrypted data to decrypt. The same locks used during encryption must be provided for decryption.
FlagPurpose--PlainTextOutput as plain text
Always include --PlainText for readable output.
The request body contains sensitive data (plaintext, PINs, passwords). The same protection applied to the API key applies to ALL sensitive values:
-d '...' on the command line. The -d argument is visible in ps and shell history, which would expose plaintext data, PINs, and passwords.-d @-. This keeps all sensitive values out of the process argument list.<<'EOF') to build the JSON body and pipe it into curl.Construct the args array by mapping user requirements to flags. Order within the array doesn't matter, but group related flags and their values together for readability.
All examples use -d @- (read body from stdin) so that neither the API key, plaintext data, PINs, nor passwords appear on the command line, in shell history, or in ps output.
Encrypt with pin lock only:
bash
cat <<'EOF' | curl -s https://api.lesecure.ai/exec \
-H "Authorization: Bearer $LESECURE_API_KEY" \
-H "Content-Type: application/json" \
-d @-
{"args":["-e","<DATA>","-1","<PIN>","--PlainText"]}
EOF
Encrypt with all locks:
bash
cat <<'EOF' | curl -s https://api.lesecure.ai/exec \
-H "Authorization: Bearer $LESECURE_API_KEY" \
-H "Content-Type: application/json" \
-d @-
{"args":["-e","<DATA>","-w","<PASSWORD>","-1","<PIN>","-2","<PHONE>","-l","<START_DATE>","-r","<END_DATE>","--PlainText"]}
EOF
Decrypt:
bash
cat <<'EOF' | curl -s https://api.lesecure.ai/exec \
-H "Authorization: Bearer $LESECURE_API_KEY" \
-H "Content-Type: application/json" \
-d @-
{"args":["-d","<ENCRYPTED_DATA>","-1","<PIN>","--PlainText"]}
EOF
$LESECURE_API_KEY is set. If it is not set, show the user the one-time setup block and stop — do not proceed, do not ask the user to paste the key into chat.--PlainText
(Do NOT ask for the API key — it comes from the environment.)cat <<'EOF' | curl ... -d @- pattern. Never use inline -d '...'. This keeps all sensitive data (plaintext, PINs, passwords) out of ps output and shell history.-2) should be in E.164 format (e.g., +19199870623).YYYY/MM/DD HH:MM. See the "Date & Time Rules" section above — always EST/EDT, always +2 min buffer on start.-l (start) and -r (end) to define the access window.