Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using EncryptByPassPhrase to encrypting some columns.

If I want to change the passphrase in the future, how can I change it?

share|improve this question
up vote 2 down vote accepted

You'll need to decrypt the data using the existing password then encrypt the value using the new password.

share|improve this answer

The question of key management is a tough one. While the question regards PostgreSQL, the conceptual overview may apply to you. You may want to read Craig's answer to Database encryption and key management with pg_crypto as the concepts should apply anywhere.

The basic overview is you want to keep passphrases separate from user access, using public/private key pairs (private keys encrypted with user-provided passphrases). Then you can decrypt the passphrase, change it globally for the sensitive information at issue. This can be done so that users can still access the data they have access to because the passphrase is encrpyted with their public keys.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.