Format-Preserving Encryption for Snowflake
Encrypt and decrypt sensitive data directly in Snowflake SQL with Java UDFs. Upload a JAR, register the functions, and protect PII without changing your schema.
What It Does
Cyphera for Snowflake delivers format-preserving encryption as native Java UDFs. Upload the Cyphera JAR to a Snowflake stage, register the functions, and call cyphera_protect to encrypt and cyphera_access to decrypt from any SQL query. Data Protection Headers are embedded in the output so access needs no configuration name. Encrypted values maintain their original format — an SSN stays an SSN, a phone number stays a phone number.
Quick Example
SELECT cyphera_protect('ssn', '123-45-6789'); -- → 'T01948-37-2150' (DPH-formatted, format preserved) SELECT cyphera_access(cyphera_protect('ssn', '123-45-6789')); -- → '123-45-6789'
How It Works
Build the JAR with Maven, upload it to a Snowflake stage, and register the UDFs using the provided SQL scripts. The deployment process is straightforward:
-- Create a stage and upload the JAR CREATE STAGE IF NOT EXISTS cyphera_stage; PUT file://target/cyphera-snowflake-0.1.0.jar @cyphera_stage AUTO_COMPRESS=FALSE;
Once the JAR is staged, the demo SQL script registers all functions and you can start encrypting immediately.