Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.