Data Vault
Data Vault is a library for storing and retrieving Credit Card data via Tokens.
# Cargo.toml
[]
= "^0.2"
# .env OR environment variables
REDIS_URL=redis://:foobared@127.0.0.1/
# REDIS_POOL_MAX_SIZE=16
ENCRYPTED_DATA_VAULT_KEY=000102030405060708090a0b0c0d0e0f
ENCRYPTED_DATA_VAULT_IV=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
// example.rs
// traits
use DataVault;
use Encryption;
// Interchangeable backend
use RedisDataVault;
// Interchangeable encryption
use AesGcmSivEncryption;
// Interchangeable tokenizer
use Blake3Tokenizer;
// credit card type
use CreditCard;
use tokio;
async
Current Features
- Store Credit Cards
- Store
String
- Automatic Encryption and Decryption
- Blake3 tokenization
- Redis pool
- Postgres pool
- Configurable from .env file or Environment Variables
- Interchangeable Backend
- Interchangeable Encryption
- Interchangeable Tokenization hasher
Performance (AMD Ryzen 9 3900X)
Redis
This example output the following performance stats Tokenized ~100,000 credit cards per second.
tokenized and stored 100000 credit cards in 1.058474365s
retrieved 100000 credit cards in 5.353857633s
tokenized, stored, and retrieved 100000 credit cards in 6.412331998s
Postgres
This example output the following performance stats Tokenized ~1,500 credit cards per second.
tokenized and stored 1000 credit cards in 635.963241ms
retrieved 1000 credit cards in 938.834896ms
tokenized, stored, and retrieved 1000 credit cards in 1.574798137s