Reference: SAORI/1.0 (external site)
This is an extension specification for sending SAORI/1.0 requests to the baseware using Direct SSTP, rather than the DLL request function, and calling functionality built into the baseware (built-in modules) as SAORI. [SSP 2.9.13]
From SHIORI's perspective, this is “SAORI that can be used without placing a DLL.” The baseware provides functions such as hashing, encryption, random number generation, and date and time calculations, which ghosts previously bundled with DLLs individually.
The first half of this page (from the overview of SAORI/1.0 through the sender-side procedure) describes a specification independent of the baseware; the second half (built-in modules) describes modules built into SSP.
For the formal definition of SAORI/1.0, refer to the original source (external site). This page provides a brief summary of only the parts needed to read it.
EXECUTE SAORI/1.0
Charset: UTF-8
Sender: 呼び出し元の名前
SecurityLevel: Local
Argument0: 1つ目の引数
Argument1: 2つ目の引数
Lines are separated by CR+LF, and the request ends with a blank line. Arguments are ordered by number, starting with Argument0. An argument with an empty value still counts as an argument at that position.
Charset specifies the request's character encoding, and the response is returned in the same encoding.
Use GET Version SAORI/1.0 to check whether a feature is available.
SAORI/1.0 200 OK
Charset: UTF-8
Result: 結果
Value0: 複数の値を返すときの1つ目
Result. When returning multiple values, they are also included in Value0, Value1, and so on.As with Direct SSTP, use WM_COPYDATA (dwData = 9801), put a SAORI/1.0 request in lpData instead of an SSTP request, and send it to your ghost's window (hwnd in FMO).
Window and WM_COPYDATA handling (sending with SendMessage functions, cbData, and so on) is the same as for Direct SSTP.
EXECUTE SAORI/1.0
Module: internal_crypto
Charset: UTF-8
Sender: YAYA
SecurityLevel: Local
HWnd: 1234
Argument0: Digest
Argument1: sha256
Argument2: abc
.dll (e.g., internal_crypto, string). Case-insensitive.ErrorDescription: invalid parameter); if the module is unknown, returns 400 (ErrorDescription: unknown module).wParam of WM_COPYDATA is used (the same rule as for SSTP over Direct SSTP).Local over Direct SSTP (the header value is ignored).The response is sent to the HWnd (or wParam) window via WM_COPYDATA (dwData = 9801). It is a SAORI/1.0 response beginning with SAORI/.
The baseware sends the response while processing the request, so it arrives before the sender's SendMessage call returns.
SAORI over DirectSSTP is accepted only over Direct SSTP.
Sending a SAORI/1.0 request over socket SSTP or SSTP over HTTP returns SAORI/1.0 400 Bad Request and ErrorDescription: direct sstp only (for SSTP over HTTP, this response is returned as the body of an HTTP 200 response).
SAORI requests are not recorded in the SSTP log.
When sent to a ghost's window, that ghost is the caller.
If the calling ghost cannot be identified, such as when sent to the baseware's main window, the request is treated as having no ghost (unlike SSTP over Direct SSTP, a displayed ghost is not substituted). Operations that do not use a ghost work normally, while operations that depend on a ghost (asynchronous calls that deliver results via events, relative paths based on the ghost's folder, and so on) return 400 (ErrorDescription: ghost required).
The ReceiverGhostName / ReceiverGhostHWnd / ReceiverGhostUUID headers are ignored.
The baseware treats incoming messages beginning with SAORI/ (or SSTP/) as responses, not requests.
To check whether a module is available, send GET Version SAORI/1.0 with Module. If available, it returns SAORI/1.0 200 OK (Result: SSP Internal in SSP).
Versions of SSP that do not support this extension (2.9.12 and earlier) read SAORI/1.0 requests as SSTP requests and return an SSTP error (SSTP/1.0 501 Not Implemented for GET Version, SSTP/1.0 400 Bad Request for EXECUTE).
The sender should consider the module unavailable if the response does not begin with SAORI/1.0 200 or if no response arrives.
A list of SSP's built-in modules and their functions can be obtained from internal_system. The options and algorithm names accepted by functions, including those added in newer versions of SSP, can be checked with Describe.
On failure, the response includes an ErrorDescription header giving the reason as a fixed English string. This header is not in the original SAORI/1.0 specification; it follows the header of the same name in SHIORI/3.0.
The following values are used by all modules. For others, see each module's documentation.
Module does not exist.Argument0) does not exist in the module.Module is missing, or an argument is missing or invalid.Compatibility modules (compatible with DLL SAORI modules) may return 400 without ErrorDescription, as in the original implementations.
SAORI header values cannot contain newlines or leading or trailing whitespace (commas are allowed). For built-in modules, pass such data using a format such as --data-in=base64.
Functions in built-in modules (those whose names begin with internal_) run asynchronously when given the --async=identifier option. Once the request is accepted, the response is returned immediately with status 204, and the result is later delivered to the calling ghost as an event.
This cannot be used when calling without a ghost (400 ghost required). If the identifier is empty, the response is 400 (invalid parameter).
Use --async for time-consuming operations (such as hashing large files or passwords, deriving keys, or generating RSA key pairs).
In SSP, up to roughly the number of CPUs (2–4) asynchronous calls can run at the same time. Any additional calls wait in order until an earlier one finishes.
On (case-sensitive), that name is used on success, and “identifier + Failure” on failure. Avoid using the name of an existing event (such as OnBoot) as the identifier, as the result will be delivered as that event.Result of a synchronous call), Reference2 = module name, Reference3 = function name, Reference4 onward = Value0 onward.ErrorDescription in a synchronous call), Reference2 = module name, Reference3 = function name.Incorrect numbers of arguments or option names result in a 400 response upon acceptance. Errors in argument contents (such as unreadable hexadecimal) are delivered in the failure event.
A sender such as SHIORI uses SAORI over DirectSSTP as follows.
hwnd) of your own ghost using FMO or a similar method.Module and HWnd (the window to receive the response).WM_COPYDATA (dwData = 9801) to the ghost's window using a SendMessage-family function.SAORI/ that arrives at the response-receiving window in a WM_COPYDATA message (dwData = 9801) as the response.First check whether it is available using GET Version.
In YAYA and Satori, SHIORI itself performs the procedure above. Use the same syntax as for DLL SAORI, with only the module name changed to a name beginning with internal_. For how to handle cases where it is unavailable (such as older SSP versions), see the documentation for each SHIORI.
FUNCTIONEX)// 同期
_hash = FUNCTIONEX('internal_crypto', 'Digest', 'sha256', 'abc')
// 非同期:結果は OnHashDone に届く(reference[0]=識別子、reference[1]=結果)
FUNCTIONEX('internal_crypto', 'HashPassword', 'secret', '--async=OnHashDone')
OnHashDone
{
_phc = reference[1]
}
()で呼ぶ)*OnBoot
(internal_crypto、Digest、sha256、abc)
(internal_crypto、HashPassword、secret、--async=OnHashDone)
*OnHashDone
(R1)
The result is handled as Result, and additional values as Value0 onward, just as with DLL SAORI. Calls with --async return an empty value.
These are the rules shared by modules built into SSP whose names start with internal_. (Their names start with internal_ to avoid conflicts with SAORI DLLs with the same name.)
These modules can only be called from Direct SSTP. They cannot be loaded as DLLs.
Argument0 is the function name (case-insensitive), and Argument1 onward are its arguments. An unknown function name returns 400 (unknown function).
Each function takes a fixed number of positional arguments, followed by options (--name=value).
--.--name without an = is equivalent to --name= with an empty value. Options with empty values can also be written. For example, --aad= represents "empty additional authentication data." However, if an option that requires a value to be meaningful (such as --async= or --iv=) is empty, the function fails (usually with 400 invalid parameter).+ or -). Spaces, hexadecimal numbers, and decimals are not allowed. If a value cannot be read as a number, the result is 400 (invalid parameter); if it does not fit in a signed 64-bit integer, the result is 400 (out of range). The valid range is determined by each function.--, or an option not accepted by the function, results in 400 (invalid parameter). This can happen when passing an option added in a newer SSP to an older SSP, so you can check whether an option is supported with internal_system's Describe.-- in the second or later position as options.--async=identifier.Argument0: Digest
Argument1: sha256
Argument2: SGVsbG8=
Argument3: --data-in=base64
Argument4: --out=base64
Hashes and similar operations work with byte sequences, but SAORI can pass only strings. Each argument that takes a byte sequence has a name (such as data, key, password, salt, ciphertext, signature, a, and b; see each function's description), and you can change how the argument is read with --name-in=format. For example: --key-in=hex, --data-in=base64.
Byte sequences passed as options (--aad=, --iv=, --info=) work the same way; you can change how they are read with options such as --aad-in=hex.
--charset= (default: UTF-8). This is not the request's Charset (so the result is the same regardless of the sender's character encoding, as with Web API signatures). If a character cannot be represented in that encoding, the result is 400 (invalid encoding).invalid encoding).=) is optional. Both formats accept characters from base64 and base64url (+ / - _). Any other character or invalid padding results in 400 (invalid encoding).invalid encoding).+ is not converted to a space. If the two characters after % are not hexadecimal digits, the result is 400 (invalid encoding).npub1... / nsec1...; bech32m cannot be read). Converts the data part to a byte sequence. The part before 1 (the HRP, such as npub) is ignored, so check the beginning of the string in your script if you need to verify its type. All-uppercase and all-lowercase strings are accepted. Mixed case, an invalid checksum, or an invalid character results in 400 (invalid encoding). There is no length limit (BIP-173's limit of 90 characters does not apply).data in Digest / HMAC in internal_crypto (using it with another function or an argument other than data results in 400 invalid parameter).file not found); if reading fails partway through, the result is 500 (file read failed).The default format is defined for each argument (see each function's description). Decoded data is limited to 8 MB per argument (too large), but since a Direct SSTP request itself is limited to 1 MB, the actual limit is lower. file is read in chunks, so it has no size limit.
Functions that return byte sequences can change how the result is written with --out=format. The default format is defined for each function. The default output format matches the default input format for the same name, so you can pass the output directly to another function.
HEX in --out= is an exception: the output is uppercase only when written as HEX (Hex produces lowercase hexadecimal). For input --name-in=, HEX is read as the same format as hex.A-Z a-z 0-9 - . _ ~) to %XX (uppercase).npub, 1–83 characters) with --hrp=. Only Convert in internal_data accepts --hrp=; using --out=bech32 with another function results in 400 (invalid parameter).--charset= (default: UTF-8). If the bytes cannot be converted back correctly using that encoding, or contain NUL or a newline (which cannot be written in a SAORI header), the result is 500 (not text).Charset encoding, so characters that cannot be represented in that encoding become ?. To ensure any character can be received, send the request with Charset: UTF-8.For --charset=, specify a character encoding name (such as UTF-8, Shift_JIS, or EUC-JP). An unknown name, UTF-16, or UTF-32 results in 400 (invalid parameter).
These rules apply to arguments that specify files (--data-in=file and the functions in internal_file).
ghost required)./ and \ can be used as separators.file not found).CompressArchive), the result is 400 (invalid parameter).--data-in=file, MediaInfo / ImageInfo / IsMediaLoadable / IsImageLoadable, the archive for ExtractArchive, and the source for CompressArchive) can read files outside SSP-managed folders when given an absolute path. Only write destinations (the destination for CompressArchive and the extraction destination for ExtractArchive) are restricted to SSP-managed folders. Since file existence can be determined by whether the result is file not found, do not pass user input or similar directly as a path.On success, the result is returned in Result with status 200. If the result is an empty string, the status is 204. Functions that return a boolean return 1 (true) or 0 (false) with status 200. A result such as "no match" is not a failure.
In addition to the common cases, ErrorDescription can contain the following:
--name-in=, or compressed data is corrupted.--data-in=file does not exist.--out=text.exp) / the current time is before its valid-from time (nbf).Data format conversion, compression, and decompression.
Converts data to another format (base64 ⇔ hexadecimal ⇔ percent-encoding ⇔ string, etc.). Specify the input with --data-in= and the output with --out=.
text)--data-in= / --out= (default is text) / --charset= / --hrp= ([SSP 2.9.14] hrp for --out=bech32)Argument0: Convert
Argument1: 48656c6c6f
Argument2: --data-in=hex
Argument3: --out=base64
→ Result: SGVsbG8=
Argument0: Convert
Argument1: 7e7e9c42a91bfef19fa929e5fda1b72e0ebc1a4c1141673e2794234d86addf4e
Argument2: --data-in=hex
Argument3: --out=bech32
Argument4: --hrp=npub
→ Result: npub10elfcs4fr0l0r8af98jlmgdh9c8tcxjvz9qkw038js35mp4dma8qzvjptg
Compresses data.
gzip / zlib / deflate (raw deflate without a header)text)--data-in= / --level= (0–9. If omitted or set to -1, zlib's default is used. Values outside the range return 400 out of range) / --out= (default is base64) / --charset=Decompresses compressed data. gzip can also read concatenated members.
If the data is corrupted, truncated, or followed by extraneous data, 400 (invalid encoding) is returned. The decompressed size is also limited to 8MB (exceeding this returns 400 too large).
gzip / zlib / deflate / brotli / zstd (brotli and zstd support decompression only)base64)--data-in= / --out= (default is text) / --charset=Argument0: Decompress
Argument1: gzip
Argument2: H4sIAAAAAAAACvNIzcnJBwCCidH3BQAAAA==
→ Result: Hello
Hashing, MAC, symmetric-key encryption, key derivation, password hashing, data protection (DPAPI), one-time passwords (TOTP), public-key signatures and key agreement.
The algorithm names for Digest / HMAC (and --digest= for DeriveKey / TOTP) are as follows. Hyphens, underscores, and letter case are ignored (SHA-256, sha_256, and sha256 are equivalent). Other names return 400 (unsupported algorithm).
md5 sha1 sha224 sha256 sha384 sha512 sha512-256 sha3-224 sha3-256 sha3-384 sha3-512 blake2b512 blake2s256
Digest also accepts the non-cryptographic checksums crc32 / adler32 ([SSP 2.9.27]).
Available algorithm names and options can be checked with internal_system's Describe.
Calculates a hash value.
crc32 / adler32, checksums that are not for cryptographic use [SSP 2.9.27])text; file can also be used)--data-in= / --out= (default is hex) / --charset=Argument0: Digest
Argument1: sha256
Argument2: abc
→ Result: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Strings are hashed by default as UTF-8 byte sequences. To hash a Shift_JIS byte sequence, specify --charset=Shift_JIS.
[SSP 2.9.27] crc32 (CRC-32, same as zlib, gzip, and PNG) and adler32 (Adler-32, same as zlib) are checksums used to verify that a file is not corrupted; they are not cryptographically secure (do not use them to detect tampering; use SHA-256 or similar for that). The result is 4 bytes (most significant byte first), and with the default hex for --out=, it is 8 characters (crc32 of 123456789 is cbf43926, and adler32 is 091e01de). file can also be used. These algorithms cannot be used with HMAC, DeriveKey, or TOTP (400 unsupported algorithm).
Compute an HMAC.
text)text; file can also be used)--key-in= / --data-in= / --out= (default is hex) / --charset=Compare two byte sequences in the same amount of time regardless of their contents. Returns 1 if they are equal and 0 if they differ (also returns 0 if their lengths differ).
Use this when you do not want the contents to be inferred from the comparison time, such as when checking a Webhook signature. When comparing hexadecimal signatures, use --a-in=hex --b-in=hex to ignore differences in letter case.
text)text)--a-in= / --b-in= / --charset=The supported algorithms are as follows (hyphens and underscores in names, and letter case, are ignored). Other algorithms return 400 (unsupported algorithm).
The key length must exactly match the algorithm's key length (32 bytes for AES-256 and ChaCha20, 16 bytes for AES-128); otherwise, 400 (invalid key) is returned. To derive a key from a password, use DeriveKey.
Generate the nonce / IV randomly for each encryption and prepend it to the ciphertext. --iv= (to specify a nonce / IV) and --pack=none (not to prepend it) are intended only for cases where another system passes the nonce separately. Reusing the same nonce / IV twice with the same key breaks GCM, ChaCha20-Poly1305, and CTR as encryption (plaintext is exposed and tampering becomes possible). Do not use a fixed value for --iv= or reuse it.
All invalid options return 400 (invalid parameter).
--aad= was specified for an unauthenticated algorithm (CBC, CTR, or chacha20).--iv= is not exactly the length of the algorithm's nonce / IV (“12 bytes” or “16 bytes” above).none was specified for --pack=.Encrypt using symmetric-key cryptography.
text)text)--key-in= / --data-in= / --aad= (additional authenticated data; authenticated encryption only. --aad-in=, default format is text) / --iv= (--iv-in=, default format is hex) / --pack=none / --out= (default is base64) / --charset=Argument0: Encrypt
Argument1: aes-256-gcm
Argument2: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Argument3: secret message
Argument4: --key-in=hex
→ Result: (毎回違うbase64)
Decrypt ciphertext produced by Encrypt.
If decryption fails, returns 500 (authentication failed). With authenticated encryption, this happens if the ciphertext, authentication tag, or --aad= differs. With CBC, this happens if the padding is invalid. This also happens if the ciphertext is shorter than the initial nonce / IV (or, for authenticated encryption, shorter than that plus the trailing authentication tag). Unauthenticated CTR and chacha20 return some value even with an incorrect key.
text)base64)--key-in= / --ciphertext-in= / --aad= / --aad-in= / --iv= / --iv-in= / --pack=none / --out= (default is text) / --charset=When using --pack=none, --iv= is required. If --pack=none is not used (the nonce / IV is at the start of the ciphertext), specifying --iv= returns 400 (invalid parameter).
Derives a byte sequence for use as an encryption key from a password or similar input. Specify parameters for each method as options; specifying an option that is not used by the method returns 400 (invalid parameter).
Since this operation uses time and memory, --async is recommended.
pbkdf2 / hkdf / hkdf-extract / hkdf-expand / scrypt / argon2idtext)text)--password-in= / --salt-in= / method-specific options below / --out= (default is hex) / --charset=--digest= (default is sha256) / --iterations= (default is 600000; 1–10000000)--digest= (default is sha256) / --info= (--info-in=, default format is text). The password is the input key (IKM) and cannot be empty (an empty value returns 400 invalid parameter). The salt may be empty.--digest= (default is sha256). The password is the input key (IKM; it cannot be empty, and an empty value returns 400 invalid parameter); the salt is used as is. The result is the PRK, and its length must be exactly the hash length (32 for sha256), or 400 (out of range) is returned.--digest= (default is sha256) / --info=. The password is the PRK (it cannot be empty; an empty value returns 400 invalid parameter). The salt must be empty (a non-empty value returns 400 invalid parameter). The length can be up to 255 times the hash length.--n= (default is 8192; must be a power of 2 and at least 2, or 400 invalid parameter is returned) / --r= (default is 8) / --p= (default is 10; 1–16). N×r×128 bytes must not exceed 12 MiB.--iterations= (default is 3; 1–1000) / --memory= (KiB; default is 12288; lanes×8–12288) / --lanes= (default is 1; 1–16). The salt must be at least 8 bytes (a shorter value returns 400 invalid parameter), and the length must be at least 4 (a shorter value returns 400 out of range). The version is 1.3 (0x13). Secret keys (secret) and associated data cannot be used.Values outside the allowed ranges return 400 (out of range). The default parameters use a combination of OWASP-recommended values that stays within the memory limit (12 MiB).
Argument0: DeriveKey
Argument1: pbkdf2
Argument2: password
Argument3: salt
Argument4: 20
Argument5: --digest=sha1
Argument6: --iterations=4096
→ Result: 4b007901b765489abead49d926f721d065a429c1
Hashes a password for storage and returns it as a PHC string (a single-line string combining the method, parameters, salt, and hash). The salt is a 16-byte random value generated each time, the hash is 32 bytes, and the parameters are fixed as shown in the table below (using an OWASP-recommended configuration that fits within the 12 MiB memory limit).
Verify the stored string with VerifyPassword. --async is recommended.
text)--method= (see the table below; default is argon2id) / --password-in= / --charset=$argon2id$v=19$m=12288,t=3,p=1$ソルト$ハッシュ$scrypt$ln=13,r=8,p=10$ソルト$ハッシュ (ln is the logarithm of N to base 2)$pbkdf2-sha256$i=600000,l=32$ソルト$ハッシュ$2b$12$ + 22 salt characters + 31 hash characters. Only the first 72 bytes of the password are used.$6$rounds=656000$ソルト$ハッシュ (the salt is 16 characters)$5$rounds=535000$ソルト$ハッシュ (the salt is 16 characters)$1$ソルト$ハッシュ (the salt is 8 characters)$apr1$ソルト$ハッシュ (the salt is 8 characters; the Apache htpasswd format)_ + 4 iteration-count characters + 4 salt characters + 11 hash characters (BSDi's extended DES; the iteration count is 5001)The salt and hash are base64-encoded (without padding).
[SSP 2.9.23] bcrypt and the methods below use the crypt(3) format, intended for interoperability with other systems (/etc/shadow, htpasswd, PHP's password_hash, etc.). Hyphens and underscores, and letter case, in the --method= name are ignored. The salt and hash use the characters allowed by each format (./0-9A-Za-z), and the parameters are fixed as shown in the table above. md5-crypt, apr1, bsdi-crypt, and des-crypt are weak methods today and should only be used for interoperability. The crypt(3) format does not allow NUL (0x00) in passwords; if present, the result is 400 (invalid parameter). Passwords longer than 1024 bytes result in 400 (out of range).
Checks whether a password matches a PHC string, returning 1 if it does and 0 otherwise. Parameters are read from the PHC string. --async is recommended.
In addition to output from HashPassword, strings produced by other implementations can also be read if they have the same format ($argon2id$ (with no v= or with v=16) / $scrypt$ / $pbkdf2-sha1$ / $pbkdf2-sha256$ / $pbkdf2-sha512$). However, parameters that exceed the memory limit (12MiB), such as argon2-cffi's default of 64MiB, cannot be verified and return 400 (out of range).
[SSP 2.9.23] crypt(3) formats can also be read ($2a$ / $2b$ / $2y$ (bcrypt; all three are treated identically) / $6$ / $5$ (with no rounds= or with values below 1000 rounded up to 1000) / $1$ / $apr1$ / 20 characters beginning with _ (BSDi extended DES) / 13 characters (traditional DES)). The bcrypt cost is limited to 16, and rounds= for SHA-crypt is limited to 10000000; exceeding these limits returns 400 (out of range). $2x$ and $2$ are not supported.
Other algorithms return 400 (unsupported algorithm), malformed formats return 400 (invalid parameter), and parameters outside the range of DeriveKey return 400 (out of range; for scrypt, ln= must be between 1 and 62). If the pbkdf2 l= does not match the hash length, it is also treated as a malformed format and returns 400 (invalid parameter).
text)--password-in= / --charset=Wrap data using the OS data protection feature (Windows DPAPI). The wrapped data can be unwrapped with Unprotect only by the same user on the same PC (or by any user on the same PC if --scope=machine is specified).
This is intended to prevent tokens and similar data stored in save data from being read if copied to another PC or another user's account; it does not isolate ghosts from each other (other ghosts or programs running as the same user can unwrap the data).
text)--data-in= / --scope=user (default) / --scope=machine (any other value results in 400 invalid parameter) / --out= (default is base64) / --charset=If save data is moved to another PC (for example, by sharing SSP save data, synchronizing it through cloud storage, or copying it manually), or if the Windows user account is recreated, the data can no longer be unwrapped. Scripts should handle Unprotect failures by, for example, asking the user to log in again.
Unwrap data wrapped with Protect. If it cannot be unwrapped, the result is 500 (authentication failed).
base64)--data-in= / --out= (default is text) / --charset=Generate a time-based one-time password (RFC 6238; the digits produced by a two-factor authentication app). If the result has fewer digits than specified, it is padded with leading zeros.
base32; the secret key string to register with the authentication app)--key-in= / --digits= (default is 6; 6–10) / --period= (seconds; default is 30; 1–86400) (values outside the range result in 400 out of range) / --digest= (default is sha1; md5 cannot be used and results in 400 unsupported algorithm) / --time= (date and time. Use the same format as the date and time arguments in internal_time; values without a zone use the OS time zone. Defaults to the current time) / --charset=Argument0: TOTP
Argument1: GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
Argument2: --time=59
Argument3: --digits=8
→ Result: 94287082
The supported signature algorithms are as follows (hyphens and underscores in names, and letter case, are ignored). Other algorithms return 400 (unsupported algorithm). ed25519 through ps512 produce signatures equivalent to the JWT (JWS) alg values EdDSA / ES256 / ES384 / ES512 / RS256 / RS384 / RS512 / PS256 / PS384 / PS512, respectively. [SSP 2.9.27] es384 es512 rs384 rs512 ps384 ps512 were added.
--data-in=hex). Keys are passed differently from the other algorithms (see below).Pass keys as single-line DER base64 or PEM. GenerateKeyPair outputs the former (private key is PKCS#8, public key is SubjectPublicKeyInfo).
PEM includes newlines and cannot be written in a SAORI header, so pass it with newlines replaced by spaces (or with newlines removed to make it a single line). If it starts with -----BEGIN, it is read as PEM, with the content between -----BEGIN ...----- and -----END read as base64.
Private keys can be read in PKCS#8 (PRIVATE KEY), as well as PKCS#1 (RSA PRIVATE KEY) for RSA and SEC1 (EC PRIVATE KEY) for ECDSA. Password-encrypted private keys cannot be read. Public keys use SubjectPublicKeyInfo (PUBLIC KEY).
RSA keys must be 2048–4096 bits, and ECDSA keys must use the curve for the algorithm (P-256 for es256, P-384 for es384, P-521 for es512). Unreadable keys, or keys whose type or size does not match the algorithm, return 400 (invalid key).
bip340 uses raw values, not DER / PEM. The private key is 32 bytes; the public key is only the 32-byte x-coordinate (BIP-340 format, the same as a nostr public key). The default format is hex. The input format can be changed with --key-in= (with --key-in=bech32, nsec1... / npub1... can be passed as-is).
Keys with an incorrect length, or private keys equal to 0 or greater than or equal to the curve order, return 400 (invalid key). --key-in= can only be used with bip340 (using it with another algorithm returns 400 invalid parameter).
The keys for KeyAgreement (secp256k1 x25519 p256) are also raw values (see the KeyAgreement description for their format).
Creates a public-key cryptography key pair. Value0 contains the private key (PKCS#8), and Value1 contains the public key (SubjectPublicKeyInfo), both base64-encoded DER. Result is the same as Value0.
RSA key generation can take several seconds, so --async is recommended (for asynchronous calls, the private key is placed in Reference4 and the public key in Reference5).
If needed, wrap the private key with Protect before saving it.
ed25519 / es256 (P-256) / es384 (P-384. [SSP 2.9.27]) / es512 (P-521. [SSP 2.9.27]) / rsa-2048 / rsa-3072 / rsa-4096 (RSA keys can be used with any of rs256 through ps512) / bip340 (secp256k1) / x25519 ([SSP 2.9.27]) / p256 ([SSP 2.9.27])Only for bip340, x25519, and p256, the values are raw rather than DER, and both are in lowercase hexadecimal.
Value0 contains the private key (32 bytes), and Value1 contains the public key with only the x-coordinate (32 bytes). To convert them to nostr nsec / npub, use --out=bech32 with Convert. This key can also be used as-is with secp256k1 in KeyAgreement.Value0 contains the private key (32 bytes), and Value1 contains the public key (32 bytes). It can be used as-is with x25519 in KeyAgreement.Value0 contains the private key (32 bytes), and Value1 contains the uncompressed public key (65 bytes; begins with 04). It can be used as-is with p256 in KeyAgreement. Its format differs from the signing key for es256 (DER).Sign data with a private key.
text)--data-in= / --out= (default is base64url; bip340 uses hex) / --charset= / --key-in= (bip340 only; default is hex) / --aux= (bip340 only; 32 bytes of auxiliary random data for BIP-340. --aux-in=, default format is hex. Random data is generated each time if omitted. Use this only when comparing against test vectors)Argument0: Sign
Argument1: ed25519
Argument2: MC4CAQAwBQYDK2VwBCIEIJ1hsZ3v/VpguoRK9JLsLMREScVpezJpGXA7rAMcrn9g
Argument3: eyJhbGciOiJFZERTQSJ9.RXhhbXBsZSBvZiBFZDI1NTE5IHNpZ25pbmc
→ Result: hgyY0il_MGCjP0JzlnLWG1PPOt7-09PGcvMg3AIbQR6dWbhijcNR4ki4iylGjg5BhVsPt9g7sVvpAr_MuM0KAg
Argument0: Sign
Argument1: bip340
Argument2: b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfef
Argument3: 243f6a8885a308d313198a2e03707344a4093822299f31d0082efa98ec4e6c89
Argument4: --data-in=hex
Argument5: --aux=0000000000000000000000000000000000000000000000000000000000000001
→ Result: 6896bd60eeae296db48a229ff71dfe071bde413e6d43f917dc8dcf8c78de33418906d11ac976abccb20b091292bff4ea897efcb639ea871cfa95f6de339e4b0a
(BIP-340 test vector 1)
Ed25519 and RSA (rs256 / rs384 / rs512) produce the same signature each time when given the same key and data. es256 / es384 / es512, ps256 / ps384 / ps512, and bip340 produce a different signature each time (all can be verified with Verify).
Verify a signature with a public key. Returns 1 if valid, or 0 if invalid (also returns 0 if the signature length is wrong). A private key may be passed instead of a public key (bip340 excluded).
For bip340, a 32-byte public key that is not a point on the curve also returns 0, as specified by BIP-340 (a different length results in 400 invalid key).
text)base64url; bip340 uses hex)--data-in= / --signature-in= / --charset= / --key-in= (bip340 only; default is hex)Derive a shared secret from your private key and the other party's public key, so that both parties obtain the same value (ECDH). The result is 32 bytes and is not hashed (secp256k1 is the point's x-coordinate as-is, as in nostr's NIP-44; x25519 is the RFC 7748 result as-is; p256 is the point's x-coordinate as-is).
Do not use the result directly as an encryption key. Pass it through hkdf (or hkdf-extract) in DeriveKey before using it.
secp256k1 / x25519 ([SSP 2.9.27]) / p256 ([SSP 2.9.27]; NIST P-256 = secp256r1 = prime256v1)hex)hex)--key-in= / --peer-in= / --out= (default is hex)Keys are raw values, not DER / PEM.
02 or 03) or 65 bytes in uncompressed form (starting with 04). A 32-byte x-coordinate alone is not accepted (unlike secp256k1, this is not a valid form for a P-256 public key).If the private key is out of range (0 or greater than or equal to the order; for x25519, not 32 bytes), or if the other party's public key is not a point on the curve or has the wrong length, the result is 400 (invalid key). Keys for x25519 / p256 can be generated with GenerateKeyPair.
Argument0: KeyAgreement
Argument1: secp256k1
Argument2: 315e59ff51cb9209768cf7da80791ddcaae56ac9775eb25b6dee1234bc5d2268
Argument3: c2f9d9948dc8c7c38321e4b85c8558872eafa0641cd269db76848a6073e69133
→ Result: 5ad01c0fc57ed5f92a0518b6440ca876eb1f247ddbb237ba1caaabbf4cebbdce
Argument0: DeriveKey
Argument1: hkdf-extract
Argument2: 5ad01c0fc57ed5f92a0518b6440ca876eb1f247ddbb237ba1caaabbf4cebbdce
Argument3: nip44-v2
Argument4: 32
Argument5: --password-in=hex
→ Result: 3dfef0ce2a4d80a25e7a328accf73448ef67096f65f79588e358d9a0eb9013f1
(NIP-44 conversation key. NIP-44 test vector)
Argument0: KeyAgreement
Argument1: x25519
Argument2: 77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a
Argument3: de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f
→ Result: 4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742
(RFC 7748 §6.1 test vector. For p256, use i from RFC 5903 §8.1 as the private key and 04 + the x and y coordinates of gr as the other party's public key to obtain d6840f6b42f6edafd13116e0e12565202fef8e9ece7dce03812464d04b9442de)
p256 are SSP 2.9.27)Cryptographically secure random numbers (OpenSSL's RAND_bytes).
Return a random byte string. Use it to generate salts, tokens, and similar values.
out of range)--out= (default is hex)Select one integer uniformly at random from the inclusive range between the minimum and maximum. Supports the range of signed 64-bit integers. If the minimum is greater than the maximum, return 400 (invalid parameter).
Return a UUID (RFC 9562) in lowercase canonical form (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
Version 4 is entirely random. For version 7, the first 48 bits represent the current time (UNIX time in milliseconds), making UUIDs easier to sort in creation order (ordering within the same millisecond is not guaranteed).
--version=4 (default) / --version=7 (any other value returns 400 invalid parameter)Date-time formatting and calculations. Internally, date-times are handled as UTC epoch seconds (seconds since 1970-01-01T00:00:00Z, in the same units as YAYA's GETSECCOUNT).
A date-time argument must be written in one of the following forms. If it cannot be parsed as any of them, the result is 400 (invalid parameter). Nonexistent dates (such as February 30) also result in 400.
2026-10-11, 2026-10-11T21:00:00+09:00, 2026-10-11 21:00, and 20261011T210000Z. Fractional seconds are discarded.Z or +09:00) are interpreted as times in the --tz= zone. For how times during daylight saving transitions—times that occur twice or do not exist—are handled, see Zones.Sun, 11 Oct 2026 12:00:00 GMT.The supported range is 0001-01-01 to 9999-12-31 in UTC (from 1601 onward when --tz=local). Values outside this range result in 400 (out of range).
However, ISO 8601 and HTTP date strings can only represent dates from 1601 onward (earlier dates result in 400 invalid parameter; they can be specified as integer epoch seconds).
The range is determined in UTC, so formatting dates near 9999-12-31 in an eastern zone (such as +09:00) may produce a five-digit year, 10000.
Asia/Tokyo or America/New_York) or a Windows time zone name (such as Tokyo Standard Time). Case-insensitive. Applies daylight saving time for the given date and time.invalid parameter). It is not treated as UTC.Rules for named zones are limited to the scope of the OS time zone information. For historical rules not included in the OS information (often those from before the 2000s), the rules for the earliest year available on the OS are used instead.
When converting a zoned date and time (wall-clock time) to UTC (when reading a zone-less ISO 8601 date and time, or when calculating the result of adding day or a larger unit in Add), times around daylight saving time transitions can be ambiguous. For both local and named zones, regardless of whether the zone is west (negative offset) or east (positive offset), the following rules apply. [SSP 2.9.27]
2026-11-01T01:30 in America/New_York is 2026-11-01T01:30:00-04:00.2026-03-08T02:30 in America/New_York is 2026-03-08T03:30:00-04:00, and 2026-03-29T02:30 in Europe/Berlin is 2026-03-29T03:30:00+02:00.Before [SSP 2.9.26], in zones with a negative offset, a nonexistent time was moved back by one hour (02:30 in America/New_York became 01:30-05:00). The choice of occurrence for times that happened twice was also reversed between zones east and west of UTC.
Formats a date-time in the --tz= zone. Weekday and month names are fixed in English (independent of language and regional settings).
iso8601 if omitted or empty)--tz=The format can be one of the following names or a format using %. An unknown format name or % character results in 400 (invalid parameter).
2026-10-11T21:00:00+09:00. If the offset is 0, the suffix is Z.Sun, 11 Oct 2026 12:00:00 GMT. Always uses GMT, regardless of --tz=.%Y (four-digit year) %y (two-digit year) %m (month) %d (day) %H (hour) %M (minute) %S (second) %j (day of year) %u (weekday, Monday=1 to Sunday=7) %w (weekday, Sunday=0 to Saturday=6) %a (Sun) %A (Sunday) %b (Jan) %B (January) %z (+0900) %:z (+09:00) %s (epoch seconds) %% (%).% are output as-is.Argument0: Format
Argument1: 0
Argument2: %Y/%m/%d %H:%M (%a)
Argument3: --tz=+09:00
→ Result: 1970/01/01 09:00 (Thu)
Returns the date-time obtained by adding an amount to a date-time, in epoch seconds. The amount may be negative.
second / minute / hour are added as elapsed time. day and larger units are added using the calendar in the --tz= zone (so the time remains the same even when crossing a daylight saving transition).
Dates are clamped to the end of the month (January 31 + 1 month = February 28 or 29).
If the result is a nonexistent time during a daylight saving transition (a time skipped when the clock moves forward), it becomes the time after the transition. If the result is a time that occurs twice, the earlier one is used (see Before and after daylight saving transitions).
secondminutehourdayweekmonthyear (plural forms such as days are also allowed)--tz=Returns the integer difference between date-time 2 and date-time 1, counted in the specified unit. Fractions are truncated toward zero.
day and larger units are counted using the calendar in the --tz= zone. For example, if date-time 2 is specified as a date only (midnight that day), the number of days remaining decreases by one at midnight in the --tz= zone. month / year are counted in calendar months; the result is the largest number that can be added with Add without passing date-time 2 (from January 31, one month later is the same time on February 28 in a common year, or February 29 in a leap year).
--tz=Argument0: Diff
Argument1: 2026-12-20T10:00
Argument2: 2026-12-24
Argument3: day
→ Result: 3(3日と14時間なので3)
If you need the difference between calendar dates (that is, “how many days from today”), specify date-time 1 as a date only as well (you can create today's date with %Y-%m-%d in Format).
String processing.
Normalizes a string to a Unicode normalization form. Use this to make strings with different code points but the same appearance consistent before comparing them, such as half-width and full-width katakana or precomposed characters and sequences of combining characters.
Uses OS functionality (NormalizeString on Windows Vista and later; on XP, uses normaliz.dll from the IDN add-on package if available). Returns 500 (internal error) on operating systems where this is unavailable. Results may vary depending on the OS's Unicode version. An empty string returns an empty string (204). A string containing an unpaired surrogate results in 400 (invalid encoding).
NFC / NFD / NFKC / NFKD (case-insensitive; anything else results in 400 unsupported algorithm)Argument0: Normalize
Argument1: NFKC
Argument2: ガイド①
→ Result: ガイド1
Creation and verification of JWTs (RFC 7519). The format is limited to the compact form of JWS (header.payload.signature).
The supported algorithms are as follows (case-insensitive in arguments and --alg=). Any other value, including none, returns 400 (unsupported algorithm).
--key-in= (default is text; strings are UTF-8). If the key is shorter than the hash length (32 bytes for HS256, 48 bytes for HS384, and 64 bytes for HS512), 400 is returned (invalid key; required by RFC 7518).EdDSA supports only Ed25519; the curves for ES256, ES384, and ES512 are P-256, P-384, and P-521, respectively). --key-in= cannot be used (400 invalid parameter). [SSP 2.9.27] RS384, RS512, PS384, PS512, ES384, and ES512 were added.Sign the payload to create a JWT.
The payload must be a JSON object and is used as written (in UTF-8). If it is not a single JSON object, return 400 (invalid parameter).
The header has the form {"alg":"HS256","typ":"JWT"}. Add header fields such as kid by writing a JSON object in --header= (if typ is specified, it takes precedence; if alg is specified, it must match Argument1 or return 400 invalid parameter).
--header= (JSON) / --key-in= (HS* only)Argument0: Sign
Argument1: HS256
Argument2: 0123456789abcdef0123456789abcdef
Argument3: {"sub":"sakura","exp":4102444800}
→ Result: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzYWt1cmEiLCJleHAiOjQxMDI0NDQ4MDB9.eJKcQzLKm4FjTltXWvPqonVpfwhVaBgpvf9nZw0szuM
Verify the JWT signature and expiration, and return the payload (JSON) if valid. If the payload contains line breaks, replace them with spaces before returning it (this does not change its meaning as JSON).
--alg= must always be specified (if omitted, return 400 invalid parameter). Do not trust the token header's alg; fail if it does not match the specified value (to prevent algorithm substitution or forgery using none).
Check exp (expiration time) and nbf (time before which the token is not valid) if present. Other fields such as iss, aud, and iat are not checked; check them in a script if needed.
--alg= (required) / --leeway= (seconds; allowed clock skew; default is 0; range 0–86400) / --key-in= (HS* only) / --time= (date and time to use instead of the current time. Use the same format as the date-time argument for internal_time. Defaults to the current time)Failures are as follows.
alg differs from --alg= (case-sensitive). Header contains crit. Token is malformed (not split into 3 parts, not readable as base64url, header or payload is not a JSON object, or invalid UTF-8). exp / nbf is not numeric.exp + leeway (the token expires exactly at the time specified by exp).nbf.Argument0: Verify
Argument1: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzYWt1cmEiLCJleHAiOjQxMDI0NDQ4MDB9.eJKcQzLKm4FjTltXWvPqonVpfwhVaBgpvf9nZw0szuM
Argument2: 0123456789abcdef0123456789abcdef
Argument3: --alg=HS256
→ Result: {"sub":"sakura","exp":4102444800}
Operations on files themselves. (For operations that only read a file's contents as a byte sequence, use the options accepted by each function, such as --data-in=file for Digest / HMAC in internal_crypto.)
Gets the tags, duration, and dimensions of an audio or video file without loading the file (without preparing to play it; only the header and tags are read). The values can be read using only the path, without creating an element with \![sound]. No elements are added to the sound.* list, no OnSound* events are fired, and no temporary files are created. [SSP 2.9.27] Read image dimensions with ImageInfo. Handling of image files passed to MediaInfo is not guaranteed (as of [SSP 2.9.25], SSP still returns the image's Result and width / height).
Values may not be available depending on the environment. [SSP 2.9.32] SSP reads MP3 and other ID3 tags (v1 / v2.2 / v2.3 / v2.4), FLAC, Ogg Vorbis, and Opus comments, and WAV / AVI INFO tags itself. For other formats (such as MP4, WMA, and MKV / WebM) and items SSP could not read, it relies on the OS property handler (the same mechanism used to show file details in Explorer). Therefore, values are empty if the OS has no handler for the format, or if the handler does not return certain items (these cases cannot be distinguished from a file without tags). Failure to retrieve a value does not result in an error.
Note that a synchronous call pauses the ghost while reading. Reading may take time depending on where the file is stored (such as on a network drive), so consider using --async.
/ and \ can be used as separators. Passing a relative path in a call without a ghost returns 400 (ghost required). If the file does not exist (including if the path is a folder), returns 400 (file not found). URLs are not accepted.invalid parameter), and up to 11 keys are allowed (12 or more returns 400 invalid parameter). Keys are case-insensitive.The keys are as follows. All values are strings (numeric values are decimal integers). Tag items have the same names and meanings as sound.(element name).meta.*.
3/12 becomes 3).The response's Result indicates the media type and is either audio or video. It is empty if the type cannot be determined. [SSP 2.9.32] The type is also determined from the file contents for Ogg, Opus, WebM, and other formats where the OS does not return a type (Matroska / WebM is video if it has a video track, and audio otherwise). The type is only a guide, so Value may still be populated when Result is empty. Do not branch on Result; check whether Value is empty. More types may be added in the future.
Value0 and later correspond in order to the keys listed in Argument2 and later. Values that could not be retrieved and unknown keys return an empty string (this is not an error; implementation-specific keys are not returned). Unreadable or unsupported formats do not return 400; instead, they return 200 with both Result and all Value fields empty.
0x01 (CRLF is replaced with a single 0x01; LF and CR alone are each also replaced with a single 0x01). NUL characters are removed.; (a semicolon and two half-width spaces).Charset.Argument0: MediaInfo
Argument1: sound/bgm01.mp3
Argument2: title
Argument3: artist
Argument4: duration
Argument5: --async=OnMediaInfo
→ 204(結果はOnMediaInfoイベントで届く)
Reference0: OnMediaInfo
Reference1: audio
Reference2: internal_file
Reference3: MediaInfo
Reference4: タイトル
Reference5: アーティスト
Reference6: 215000
Gets the dimensions of an image file without loading the file (by reading only its header). The image can be read from its path alone, without creating a surface or anything similar.
The information may not be available in some environments. SSP first reads it using the OS property handler (the same mechanism used for file details in Explorer); if that fails, SSP reads only the file header itself (without decoding the image). The formats whose dimensions can be read from the header are PNG (APNG) / JPEG / GIF / BMP / TIFF / WebP / ICO and CUR (largest entry) / PSD / XCF / PSP (version 4.0 and later) / QOI / PCX / TGA / PBM / PGM / PPM / PAM / PFM / XBM / XPM / MAG / PI. For ORA / KRA / CLIP (formats whose dimensions can only be determined by decompressing the contents), the result is empty if no OS handler is available. Failure to retrieve the information is not an error.
When reading from the header, the dimensions are for the first page of TIFF files, the logical screen of GIF files, and the largest entry of ICO and CUR files. EXIF orientation (rotation) is not applied.
Note that calling this synchronously stops the ghost while the file is being read. Reading can take time depending on where the file is stored (for example, on a network drive), so consider using --async as well.
Use MediaInfo to read audio and video tags and durations.
/ and \ can be used as separators. If a relative path is passed in a call without a ghost, the result is 400 (ghost required). If the file does not exist (including if the path is a folder), the result is 400 (file not found). URLs are not accepted.invalid parameter), and up to 11 can be specified (12 or more results in 400 invalid parameter). Keys are case-insensitive.The keys are as follows. Values are decimal integer strings.
The response Result is image if the file is identified as an image, or empty otherwise. If it cannot be identified as an image (including audio and video files), all Value fields are empty.
Value0 onward correspond in order to the keys listed from Argument2 onward. Values that could not be retrieved and unknown keys return an empty string (this is not an error; implementation-specific keys are not returned). Unsupported or unreadable formats do not result in 400; instead, 200 is returned with both Result and all Value fields empty.
The response character encoding follows the request's Charset.
Argument0: ImageInfo
Argument1: image/bg01.png
Argument2: width
Argument3: height
→ 200
Result: image
Value0: 640
Value1: 480
Checks whether SSP can handle an audio or video file. Determines this from the extension without loading the file.
The check uses the same component as the check for whether an audio or video file can be opened in the built-in media player when dragged and dropped onto SSP (the set of extensions that OS DirectShow / Media Foundation may be able to play). Since the file contents are not checked, a file may not actually be playable even if the result is read.
Images always return none, regardless of format. Images readable by SSP's built-in loader (including those identified as images by the header at the start of the file, not just by their extension) and images with extensions readable by OS WIC (such as HEIC) return none here, even if their extensions appear in the OS DirectShow extension table. In other words, images for which IsImageLoadable returns embed / write, and images that return read based on their extension, return none from this function. Use IsImageLoadable to check whether an image can be read.
/ and \ can be used as separators. Passing a relative path in a call without a ghost returns 400 (ghost required). If the file does not exist (including if the path is a folder), returns 400 (file not found). URLs are not accepted.The response's Result indicates the handling level and is one of the following.
The same four levels as IsImageLoadable are used. Each subsequent level includes the previous levels. Since embed and write may be returned in the future, it is safer to check whether the result is not none rather than whether it equals read.
Argument0: IsMediaLoadable
Argument1: sound/bgm01.mp3
→ 200
Result: read
Checks how well SSP can handle an image file. Determines this from the header and extension without loading the file. This function lets a ghost check in advance whether an image can be used as a surface or balloon image, or whether it can be saved.
The check uses the same component as the check for whether an image file can be opened in the built-in picture viewer when dragged and dropped onto SSP.
/ and \ can be used as separators. Passing a relative path in a call without a ghost returns 400 (ghost required). If the file does not exist (including if the path is a folder), returns 400 (file not found). URLs are not accepted.The response's Result indicates the handling level and is one of the following.
Each subsequent level includes the previous levels (write also means embed). As with the actual loader, the check prioritizes the leading header, and checks the extension if the header is inconclusive. EXE / DLL files (used for extracting icons) are not counted as images.
The level may vary depending on the SSP version and OS environment. More levels may be added in the future.
Argument0: IsImageLoadable
Argument1: image/bg01.png
→ 200
Result: write
Compresses a folder into a ZIP file (or 7z file). This makes the same processing as CompressArchive in SSTP EXECUTE available through SAORI over DirectSSTP.
The archive format is determined by the extension of the destination path. .7z produces a 7z archive (compressed using LZMA); all other extensions produce ZIP archives (specifying .lzh or .cab still produces a ZIP archive).
Archive processing may take several seconds, so --async is strongly recommended. If called synchronously, the ghost stops during processing.
/ and \ can be used as separators. If a relative path is passed in a call without a ghost, the result is 400 (ghost required).file not found). This path is not limited to folders managed by SSP; folders outside its management can also be compressed (only the destination is restricted). [SSP 2.9.33] Passing something that is not a folder (such as a file path) results in 400 (invalid parameter). Before this version, passing a file path failed with 500 (file not found).The options are as follows (if the same name is specified twice, the later one takes effect).
--option=overwrite,lzma. If you specify --option= twice, only the later one takes effect).--password=). Works only for 7z and has no effect on ZIP (filenames remain unencrypted in ZIP).overwrite nor append is specified, the result is 400 (file exists).On success, the result is 200. Result contains the number of files compressed, Value0 contains the size in bytes after compression, and Value1 contains the size in bytes before compression (after extraction); all are decimal integers. These are the same values as Reference1 through Reference3 in OnCompressArchiveComplete for SSTP EXECUTE. With --async, they are returned in Reference1 (Result) and Reference4 and Reference5 (Value0 and Value1).
For ZIP, Value0 is the number of bytes added to the archive (including the header and central directory; with append, only the additional data). It is slightly larger than the size of the compressed data alone.
[SSP 2.9.26] The file count and byte counts are also returned correctly for ZIP (in [SSP 2.9.25], they were 0 when compressing to ZIP).
Failures are as follows. 400 indicates file not found (source does not exist) / invalid parameter (insufficient arguments, empty path, invalid option, or, in [SSP 2.9.33], source is not a folder) / ghost required / file exists / path not allowed (destination is outside folders managed by SSP). 500 indicates the reason for compression failure, such as open failed.
For security reasons, the destination is restricted to locations under folders managed by SSP (such as the ghost folder, balloon folder, and locations specified by the “Folder” settings). The path is checked after resolving .. and similar components. This restriction may be tightened as needed, so it is safest to limit the destination to a folder under the one containing the ghost's own data.
Argument0: CompressArchive
Argument1: save/backup.zip
Argument2: save/data
Argument3: --option=overwrite
Argument4: --async=OnBackupDone
→ 204(結果はOnBackupDoneイベントで届く)
Extracts an archive (in addition to ZIP, this includes formats such as 7z and tar; see “Supported formats” below). This makes the same operation as ExtractArchive in SSTP's EXECUTE callable through SAORI over DirectSSTP.
Archive processing may take several seconds, so --async is strongly recommended. If called synchronously, the ghost will stop while it runs.
/ and \ can be used as separators. A relative path passed in a call without a ghost results in 400 (ghost required). If the file does not exist (including a folder), the result is 400 (file not found).create directory failed).The options are as follows.
password mismatch) without showing a password prompt (in [SSP 2.9.25], a password could not be specified, and a password prompt appeared, stopping the ghost).--asyncOn success, the response is 200, with the number of extracted files in Result, the compressed size in bytes in Value0, and the extracted size in bytes in Value1 (integers in decimal). These are the same values as Reference1–Reference3 in OnExtractArchiveComplete for SSTP's EXECUTE; with --async, they are returned in Reference1 (Result) and Reference4 and Reference5 (Value0 and Value1).
For archives such as 7z that do not store the compressed size for each entry, Value0 may be 0.
[SSP 2.9.26] ZIP archives containing multiple files also return the correct total (in [SSP 2.9.25], the size was that of the last file only).
Failures are as follows. 400 indicates file not found (the archive to extract does not exist) / invalid parameter (an argument is missing or a path is empty) / ghost required / path not allowed (the extraction destination is outside SSP-managed folders). 500 indicates create directory failed or the reason extraction failed (open failed, crc, password mismatch, etc.).
For security reasons, the extraction destination is restricted to locations under SSP-managed folders (locations specified in the “Folders” settings, such as ghost and balloon folders). Paths are checked after resolving .. and similar components. Also, since this restriction may be strengthened as appropriate, it is safest to limit the destination to a folder containing the ghost's own data.
The archive format is determined by the file name extension (for self-extracting exe files, the contents are inspected and the ZIP or 7z archive inside is extracted). If the format cannot be determined, extraction fails with 500.
.zip.zipx.nar.lzh.lha.cab.7z.tar.tar.gz(.tgz) .tar.xz(.txz) .tar.bz2(.tbz2.tbz) .tar.lzma(.tlz) .tar.zst(.tzst) .tar.br(.tbr) .tar.Z(.taz) .cpio.deb.udeb.rpm.gz.bz2.xz.lzma.zst.zstd.br.Z (extracted as an archive containing one file).iso.img.eml.exe--password= applies only to ZIP and 7z; it is ignored for other formats.
Argument0: ExtractArchive
Argument1: save/backup.zip
Argument2: save/restore
Argument3: --async=OnRestoreDone
→ 204(結果はOnRestoreDoneイベントで届く)
Reference0: OnRestoreDone
Reference1: 12(展開したファイル数)
Reference2: internal_file
Reference3: ExtractArchive
Reference4: 圧縮後のバイト数
Reference5: 展開後のバイト数
MediaInfo is limited to what can be implemented without difficulty in baseware on other operating systems using existing components (ffprobe / libavformat, TagLib, standard OS media APIs, etc.).
0x01, removal of NUL); the base for relative paths (ghost/master); response form (Result + Value0..); leave keys not specified in the specification empty and do not return custom keys; accept / as a path separator.\ as a path separator (ghost authors use \, but on other operating systems \ may be an ordinary character in a filename). Join tags with multiple values using ;.Result is determined; which items can be retrieved from which formats. The mapping of tags by format (for example, ID3v2's TIT2 becoming title) is not specified.duration (as a guideline, ±100 milliseconds or 1%).Guidelines for implementation with ffprobe / libavformat:
duration is format.duration. width / height are the values from the video stream for video.streams[].tags, not format.tags.attached_pic. If these are counted as video, audio files will end up as video.track (in the form 3/12) and date (in the form 2024-05-06) need to be normalized to the specification's forms: track (track number only) and year (first 4 digits).Result to image only when the image's pixel dimensions can be retrieved, and leave all Value fields empty for audio and video files.none / read / embed / write) describe the capabilities of the baseware itself. embed means “can be incorporated into and processed by ghosts or balloons” (that is, the baseware can load it as a resource such as a surface or balloon image, or audio for \![sound]). write means “can be written in that format.” read is for formats that can be read, but are not guaranteed to be incorporated and processed; in SSP, this applies to formats for which it has no built-in loader and instead relies on OS codecs. In implementations that use their own loaders to read resources, most readable formats will be embed, so read need not be returned if there are no formats that qualify as read. Higher levels include the lower levels.file not found); otherwise, do not return an error, and return none if the file cannot be read.A list of built-in modules and how to call their functions. Use this to check from a script which functions are available and which options and algorithm names can be used.
Only modules whose names begin with internal_ appear in the list (compatibility modules do not appear).
The results of ListModules / ListFunctions are comma-separated in Result, with one item each from Value0 onward. The order has no meaning.
Returns a list of the names of built-in modules (including internal_system itself).
Argument0: ListModules
→ Result: internal_crypto,internal_random,internal_time,internal_data,internal_text,internal_jwt,internal_system,internal_file
→ Value0: internal_crypto
→ Value1: internal_random
…
Returns a list of function names in the specified built-in module. Function names are returned in their canonical spelling (including letter case).
A name that is not a built-in module (including compatibility modules) results in 400 (unknown module).
Argument0: ListFunctions
Argument1: internal_jwt
→ Result: Sign,Verify
→ Value0: Sign
→ Value1: Verify
Returns how to call a function in a built-in module (number of positional arguments, accepted options, and choices selected by name).
Functions in built-in modules fail with 400 (invalid parameter or unsupported algorithm) if passed an unknown option or algorithm name. This is what happens when you use an option or algorithm added in a newer SSP with an older SSP. Checking in advance with this function lets you determine whether it is available without calling it. ListFunctions only tells you whether the function exists.
A name that is not a built-in module (including compatibility modules) results in 400 (unknown module); a function name that does not exist in that module results in 400 (unknown function). If either is missing, the result is 400 (invalid parameter).
The results are as follows.
Argument1 onward that can appear before any options. For functions with a variable number of positional arguments (such as MediaInfo in internal_file), this is the upper limit.1 if the number of positional arguments is variable, or 0 if it is fixed. For functions with a variable number of positional arguments, values from the second positional argument onward, starting with the first value that begins with --, are read as options (common conventions).-- prefix. This includes async, which is accepted by every function. Options in the form --データ名-in= (such as data-in and key-in) are listed as-is.name=choice|choice|…; the name is Argument1 and so on for a positional argument (using the same number as the request's ArgumentN), or an option such as --digest. Choices use the same spelling as in each function's description. Functions without a fixed set of choices have no Value4 or later.Names in forms such as --out= and --data-in= (common conventions), and the format names for Format, are not included as choices.
Argument0: Describe
Argument1: internal_crypto
Argument2: KeyAgreement
→ Result: KeyAgreement
→ Value0: 3
→ Value1: 3
→ Value2: 0
→ Value3: key-in,peer-in,out,async
→ Value4: Argument1=secp256k1|x25519|p256
From this result, you can determine whether x25519 is available by splitting Value4 at = and | and checking whether x25519 is present.
SSP includes compatibility implementations for the following commonly used SAORI DLLs. When a ghost loads one of these DLLs, SSP substitutes its built-in implementation without reading the DLL (determined by the file name).
[SSP 2.9.13] These can also be called from Direct SSTP using the name with .dll removed from the DLL name (such as Module: string). Arguments and return values are the same as in the original SAORI.
houchi clipcopy textcopy saori_ip saori_cpuid mciaudio cpuusage httpc string hanayu osuwari (osuwari from [SSP 2.9.33])
load / unload, so modules that maintain state per ghost (mciaudio / httpc / string / hanayu) are initialized on that ghost's first call and discarded when the ghost exits (including when SHIORI is reloaded). They do not share state with instances loaded as DLLs.ghost required) for operations that depend on a ghost (httpc retrieval, saving, and bg; hanayu show; mciaudio load / play / loop / stop).houchi works when loaded, so calling it from Direct SSTP does nothing.bg when retrieving data with httpc (otherwise, SSP's display freezes while the data is retrieved).Compatible with ukiya's Osuwari.dll. It makes the ghost's window follow the foreground window, a specified window, or a screen rectangle (it performs the same operation as \![set,alignmenttodesktop,osuwari,…]; the meaning of the options is also described there). Arguments are positional, as in the original.
START: In order from Argument1: HWND to control / tracking target (ACTIVE FIX @title #handle) / origin (TL TR BL BR) / x offset / y offset / update interval (milliseconds; 0 means 100) / (optional) options (XMOVE YMOVE NOCLIP BACK, space-separated. BACK places the window immediately behind the target window. This option is not in the original) / (optional) fallback when it cannot be positioned (DESKTOP WORKAREA and CENTER LEFT RIGHT TOP BOTTOM, space-separated) / (optional) clipping margin (left_top_right_bottom).START are retained. This is the same behavior as the original. With \![set,alignmenttodesktop,osuwari,…], omitted options are set to their defaults each time (not retained).OnHWND event (hwnd). Other windows are not moved (500 if it cannot be found).STOP: Stops the positioning set by the SAORI and restores the ghost/shell default alignment (descript.txt). If the default in descript.txt is osuwari, it positions the window using osuwari again. It does not stop positioning set with \![set,alignmenttodesktop,osuwari,…]. It also stops when the SAORI is unloaded (including when SHIORI is reloaded).source window is not exist).side to TOP when DESKTOP is specified is not present.seriko.alignmenttodesktop,free in the shell's descript.txt.osuwari0.dll) are not covered by this compatibility implementation. The actual DLL is loaded.