FIPS-compatible RSA decryption module for AES session key handling (Node.js / Node-RED / PCI DSS)
npm install fips-rsa-cryptoFIPS-compatible RSA decryption module for decrypting AES session keys handling in secure financial or payment integrations (e.g., Payment Service Providers, banking APIs, or PCI DSS systems).
Designed for Node.js ≥18 and Node-RED, fully compliant with PCI DSS 4.0 (3.5 / 3.6).
This module was originally designed for Payment Service Provider (PSP) integrations,
where the PSP encrypts the transaction data using AES and RSA keys.
However, it can be used in any project requiring FIPS-compliant RSA decryption.
---
---
``bash`
npm install fips-rsa-crypto
bash
sudo apt install -y build-essential python3 make g++
`---
$3
`js
import { decrypt } from 'fips-rsa-crypto';
import crypto from 'crypto';// Simulated PSP response (encrypted symmetric key)
const encryptedKeyBase64 = 'MIIClzBABgkqhkiG9w0BB...'; // example data
const privateKeyPem =
;// 1️ Decrypt symmetric AES key from PSP response
const decryptedKeyJSON = decrypt(encryptedKeyBase64, privateKeyPem);
const { key, iv } = JSON.parse(decryptedKeyJSON);
// 2️ Use decrypted AES key to decrypt PSP "info" field
const encryptedInfo = 'CjAd3T8p...'; // PSP 'info' field in base64
const decipher = crypto.createDecipheriv(
'aes-256-ctr',
Buffer.from(key, 'base64'),
Buffer.from(iv, 'base64')
);
const decryptedData = Buffer.concat([
decipher.update(Buffer.from(encryptedInfo, 'base64')),
decipher.final()
]);
console.log('Decrypted PSP payload:', decryptedData.toString());
``