This guide will help you quickly set up and use the Post-Quantum Cryptography Vault Plugin.
- Go 1.21+ installed
- HashiCorp Vault CLI installed
- Access to your Vault instance at
https://kms.averox.com
# Install dependencies
make deps
# Build the plugin
make buildThis creates the vault-plugin-pqc binary in the current directory.
Copy the plugin binary to your Vault server's plugin directory. The location depends on your Vault configuration, but common locations are:
/etc/vault.d/plugins/(Linux)/usr/local/lib/vault/plugins/(macOS)- Or the directory specified in your Vault config's
plugin_directorysetting
# Example for Linux
sudo cp vault-plugin-pqc /etc/vault.d/plugins/
sudo chmod +x /etc/vault.d/plugins/vault-plugin-pqc# Set your Vault credentials using .env file (recommended)
cp .env.example .env
# Edit .env with your actual Vault token
# Or export environment variables directly
export VAULT_ADDR=https://kms.averox.com
export VAULT_TOKEN=your-vault-token-here
# Run the registration script
./scripts/register-plugin.sh /path/to/vault-plugin-pqc# Set your Vault credentials using .env file (recommended)
cp .env.example .env
# Edit .env with your actual Vault token
# Or export environment variables directly
export VAULT_ADDR=https://kms.averox.com
export VAULT_TOKEN=your-vault-token-here
# Calculate SHA256 checksum
SHA256=$(shasum -a 256 vault-plugin-pqc | awk '{print $1}')
# Register the plugin
vault write sys/plugins/catalog/secret/pqc-plugin \
sha256="$SHA256" \
command="vault-plugin-pqc"
# Enable the plugin
vault secrets enable -path=pqc pqc-plugin# List secrets engines
vault secrets list
# You should see 'pqc/' in the listvault write pqc/keys/my-encryption-key \
algorithm=kyber768 \
key_type=encryptionvault write pqc/keys/my-signing-key \
algorithm=dilithium3 \
key_type=signing# Prepare your data (base64 encoded)
PLAINTEXT=$(echo -n "Hello, Post-Quantum World!" | base64)
# Encrypt
vault write pqc/encrypt/my-encryption-key plaintext="$PLAINTEXT"# Use the ciphertext from the encryption response
vault write pqc/decrypt/my-encryption-key \
ciphertext="<CIPHERTEXT_FROM_ABOVE>"# Prepare your data
DATA=$(echo -n "Important document" | base64)
# Sign
vault write pqc/sign/my-signing-key input="$DATA"# Verify the signature
vault write pqc/verify/my-signing-key \
input="$DATA" \
signature="<SIGNATURE_FROM_ABOVE>"kyber512- NIST Level 1kyber768- NIST Level 3 (recommended)kyber1024- NIST Level 5
dilithium2- NIST Level 2dilithium3- NIST Level 3 (recommended)dilithium5- NIST Level 5
If Vault can't find the plugin:
- Check that the binary is in the correct plugin directory
- Verify the
commandname matches the binary name - Ensure the binary has execute permissions:
chmod +x vault-plugin-pqc
Ensure your Vault token has:
sys/plugins/catalog- to register pluginssys/mounts- to enable secrets enginespqc/*- to use the plugin
If you encounter build errors:
# Clean and rebuild
make clean
make deps
make build- Review the full README.md for detailed documentation
- Explore the API endpoints
- Set up key rotation policies
- Consider hybrid cryptography approaches
If you have an existing transit mount, you can use both:
# Traditional encryption
vault write transit/encrypt/my-key plaintext="..."
# Post-quantum encryption
vault write pqc/encrypt/my-pq-key plaintext="..."This allows gradual migration to post-quantum cryptography.