pqagents
v1.1.1
Published
Post-quantum cryptographic identity and verification SDK for AI agents.
Maintainers
Readme
pqagents
Post-quantum cryptographic identity and verification SDK for AI agents.
Secure your AI agents against future quantum computer threats using NIST-approved post-quantum algorithms (ML-DSA-65). This SDK provides a simple wrapper around liboqs to generate keys, sign payloads, and verify actions cryptographically.
Installation
npm install pqagentsUsage
1. Generating Agent Keys
Generate an ML-DSA-65 post-quantum keypair for your AI agent.
import { generateAgentKeys } from 'pqagents';
const keys = generateAgentKeys();
console.log('Public Key:', keys.publicKey); // Save to your database
console.log('Secret Key:', keys.secretKey); // Give securely to your agent2. Signing a Payload
When your agent performs an action (like making a database write or a trade), it should sign the payload.
import { signAgentToken } from 'pqagents';
const payload = { action: 'trade', amount: 100, asset: 'BTC' };
// The agent signs the payload using its secret key, returning a post-quantum JWT
const token = signAgentToken(payload, keys.secretKey);3. Verifying a Signature
Your backend receives the request, the payload, and the signature, and verifies it against the agent's public key.
import { verifySignature } from 'pqagents';
const isValid = verifySignature(payload, signature, keys.publicKey);
if (isValid) {
console.log('Cryptographically verified! Action approved.');
} else {
console.error('Intruder detected! Action rejected.');
}License
ISC
