encryptPAN
encryptPAN(pan: string, encryptionKey: Buffer): EncryptedPANSource: storage.ts:37
Encrypts a 16-digit PAN using AES-256-GCM.
Parameters
pan(string) — 16-digit PAN stringencryptionKey(Buffer) — 32-byte (256-bit) encryption key Buffer. Must be distinct from the CVV HMAC passkey.
Returns
EncryptedPAN— EncryptedPAN with iv, ciphertext, and authTag (all hex)
Throws
- If PAN is not 16 digits or key is not 32 bytes.