FIPS mode uses AES-256-GCM instead of the default NaCl Secretbox algorithm to encrypt secrets. AES-256-GCM is an Approved Security Function under Federal Information Processing Standard 140-3, which is required in certain US government and regulated-industry environments. Both Posit Connect and Posit Package Manager can decrypt values produced in FIPS mode, subject to minimum product version requirements.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.
Why use FIPS mode
Regulatory compliance
AES-256-GCM is an FIPS 140-3 Approved Security Function. The default NaCl Secretbox algorithm is not, so if your organization’s policy mandates FIPS-compliant cryptography you must use this mode.
AES-256-GCM vs NaCl Secretbox
NaCl Secretbox uses XSalsa20-Poly1305. It is secure and widely trusted, but not FIPS-approved. AES-256-GCM uses a NIST-standardized cipher with authenticated encryption and is accepted by FIPS 140-3 validation programs.
Product version requirements
Encrypted values produced with
--mode=fips will not decrypt on older product versions. Confirm your deployment meets these minimums before switching.| Product | Minimum version |
|---|---|
| Posit Connect | 2022.03.0 |
| Posit Package Manager | 2024.04.0 |
Encrypt with FIPS mode
Generate a key (same format)
FIPS mode uses the same 512-byte hex-encoded key format as the default mode. No special key is needed:
Encrypt with --mode=fips
Pass The output is base64-encoded. Internally it is structured as a 1-byte version prefix (
--mode=fips to use AES-256-GCM:0x02), a 12-byte nonce, and the AES-256-GCM ciphertext with a 16-byte authentication tag.You can also encrypt via stdin:Building rskey with FIPS mode enforced
Pre-built binary releases use the standard (non-enforced) build. If you need a binary that refuses to use non-FIPS algorithms entirely — for example, to prevent accidental use of NaCl Secretbox in a strictly FIPS environment — build from source with thefips build tag:
FIPSMode constant is true and any call to Encrypt (not EncryptFIPS) or decryptSecretbox returns an error immediately:
Standard
rskey binaries support both algorithms simultaneously. The fips build tag is only needed when your policy requires that non-FIPS algorithms be completely unavailable at the binary level.Algorithm auto-detection on decrypt
rskey decrypt inspects the first byte of the decoded ciphertext to determine which algorithm was used:
| Version byte | Algorithm |
|---|---|
0x02 | AES-256-GCM (FIPS mode) |
0x01 | NaCl Secretbox (versioned) |
| any other | NaCl Secretbox (legacy, no prefix) |
rskey decrypt command handles output from all three formats without requiring the caller to specify a mode.