© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
4 replies
michellesauder

Issue with pgsodium Not Decrypting Properly

Hi Supabase Team,

I'm encountering an issue when using the pgsodium extension in my Supabase project. Specifically, I am able to encrypt data, but when attempting to decrypt it, I’m getting an error or unexpected result.

Here’s a summary of the problem:

I’ve set up pgsodium and am using the pgcrypto-like encryption/decryption functions for sensitive data.
The encryption works as expected, but when I attempt to decrypt the data, I either get an error (e.g., "decryption failed") or the result doesn’t match the original plaintext data.
I’ve verified that:

The encryption and decryption keys are correctly configured.
The encryption functions work when used independently.
The correct types are being passed to the decryption function.
Could you provide guidance on what might be going wrong or if there’s a known issue with pgsodium in Supabase? Any help would be greatly appreciated.

Thanks in advance!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Vault & PGsodium
SupabaseSSupabase / help-and-questions
7mo ago
Pgsodium cipher text invalid
SupabaseSSupabase / help-and-questions
3mo ago
pgsodium - what do you recommend instead?
SupabaseSSupabase / help-and-questions
3mo ago
encrypting+decrypting API keys in DB only
SupabaseSSupabase / help-and-questions
4y ago