The terminal waited for your command, cursor blinking like a warning. This time, the script you write must do more than run — it must meet FIPS 140-3. No excuses, no half measures.
FIPS 140-3 is the NIST standard for cryptographic modules. If your system handles sensitive or regulated data, compliance is not optional. It defines how keys are generated, stored, and destroyed. It controls which algorithms are allowed and how they must be implemented. Passing means your code can stand before auditors. Failing means it cannot be trusted.
Shell scripting can enforce FIPS compliance at the operating system level. Before anything else, ensure your system runs in FIPS mode. On many Linux distributions, this means enabling /proc/sys/crypto/fips_enabled and updating kernel parameters. A simple check:
if [ "$(cat /proc/sys/crypto/fips_enabled 2>/dev/null)"-ne 1 ]; then
echo "FIPS mode is not enabled. Aborting."
exit 1
fi
Approved algorithms in FIPS 140-3 include AES, SHA-256, and RSA with specific key sizes. Your shell script must block non-approved functions. Use OpenSSL with the FIPS provider loaded:
openssl list -providers | grep fips
export OPENSSL_CONF=/etc/ssl/openssl-fips.cnf
When handling keys, store them only in approved formats and restrict their file permissions: