Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rstudio/rskey/llms.txt

Use this file to discover all available pages before exploring further.

rskey supports three distinct encryption algorithms depending on the product and deployment mode. Connect and Package Manager default to NaCl Secretbox but can be switched to AES-256-GCM for FIPS compliance. Workbench always uses AES-128-CBC for compatibility with rstudio-server.
NaCl Secretbox is the default algorithm for Posit Connect and Package Manager. It combines XSalsa20 stream encryption with a Poly1305 MAC to provide authenticated encryption.Key material used: first 32 bytes of the 512-byte key file.Nonce: 192 bits (24 bytes), randomly generated per encryption.MAC: Poly1305, providing 128-bit authentication.Implementation: golang.org/x/crypto/nacl/secretbox — the standard Go wrapper around the NaCl reference implementation.Output format:
base64( nonce[24] + ciphertext )
The nonce is prepended directly to the ciphertext before base64 encoding. There is no version byte in this legacy format.Some ciphertexts produced by older implementations carry an explicit version byte 0x01 before the nonce:
base64( 0x01 + nonce[24] + ciphertext )
rskey decrypt handles both forms transparently.Use this when: you are encrypting secrets for Connect or Package Manager and do not have a FIPS compliance requirement.

Algorithm selection

The --mode flag passed to rskey encrypt selects the algorithm:
--mode valueAlgorithmProducts
(omitted)NaCl SecretboxConnect, Package Manager
fipsAES-256-GCMConnect 2022.03.0+, Package Manager 2024.04.0+
workbenchAES-128-CBCPosit Workbench
rskey decrypt does not require a --mode flag. For Connect and Package Manager ciphertexts, the algorithm is determined from the version byte embedded at the start of the decoded payload (0x01 or 0x02 for NaCl and AES-256-GCM respectively; no version byte defaults to NaCl). For Workbench ciphertexts, the algorithm is identified by the presence of matching CRC32 checksums at the start and end of the payload string.

Build docs developers (and LLMs) love