Re: Encrypted database deployment



At what point do you get this error? What statement are you executing when
you see it?

Check that the service master key is valid: run ALTER SERVICE MASTER KEY
REGENERATE. If this fails, it means you have a problem with your service
master key, not with the database.

Also, is the OS on the machine you restored different from the one where the
database was created?

Thanks
--
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/

This posting is provided "AS IS" with no warranties, and confers no rights.

"Gerhard" <acsla@xxxxxxxxxxxxxxxx> wrote in message
news:F60CD778-4E38-4209-8E88-E960CB530579@xxxxxxxxxxxxxxxx
I restored the database, ran the open and alter commands as below, but
still
get the error:

Msg 15466, Level 16, State 1, Line 1
An error occurred during decryption.

Still looking for a way to get this successfully moved....



"Roger Wolter[MSFT]" wrote:

There's more information on OPEN here:
http://msdn2.microsoft.com/en-us/library/ms174433.aspx


--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Roger Wolter[MSFT]" <rwolter@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:evRJycVxGHA.3892@xxxxxxxxxxxxxxxxxxxxxxx
Did you run a CREATE MASTER KEY in this database before trying the OPEN
operation? If so, you just opened the new key you created - not the
key
the symmetric keys were encrypted with. You may have to go back to
your
backup that contains the original key.

--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Gerhard" <acsla@xxxxxxxxxxxxxxxx> wrote in message
news:54EF76EA-F4ED-44CD-BB7C-3EC017139AAD@xxxxxxxxxxxxxxxx
Thanks. I did still have the password, so ran the below which ran
without
error.

However, I still get:

Msg 15466, Level 16, State 1, Line 1
An error occurred during decryption.

when I try to open a symmetric key.

Can you help?

Thanks.

"Roger Wolter[MSFT]" wrote:

This issue is that the password is used to encrypt the database
master
key -
it isn't the database master key so you now have two different master
keys
encrypted with the same password which doesn't help you a lot. If
you
haven't already blown away the master key, you can re-encrypt it with
the
new service master key like this:

OPEN MASTER KEY DECRYPTION BY PASSWORD = 'password'

ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY



--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Gerhard" <acsla@xxxxxxxxxxxxxxxx> wrote in message
news:0F2B0D28-2A97-4E60-B6B8-1F821177CA87@xxxxxxxxxxxxxxxx
I have an encrypeted database that I need to move from one
development
environment to another. If I back it up and restore it to the new
environment, I get decryption errors, even though the Master Keys
have
been
created using the same password CREATE MASTER KEY ENCRYPTION BY
PASSWORD =
...

How can I move the database to the new environment?

Thanks.










.



Relevant Pages

  • Re: Encrypted database deployment
    ... Use of included script samples are subject to the terms specified at ... An error occurred during decryption. ... it isn't the database master key so you now have two different master ... ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY ...
    (microsoft.public.sqlserver.security)
  • Re: An error occurred during decryption
    ... To confirm that the error happens with the service master key, ... ALTER SERVICE MASTER KEY REGENERATE. ... server login passwords, ...
    (microsoft.public.sqlserver.security)
  • Re: Encrypted database deployment
    ... I restored the database, ran the open and alter commands as below, but still ... An error occurred during decryption. ... it isn't the database master key so you now have two different master ... ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY ...
    (microsoft.public.sqlserver.security)
  • Re: Problem after disaster recovery
    ... ALTER MASTER KEY FORCE REGENERATE WITH ENCRYPTION BY PASSWORD = ... Cannot find the symmetric key 'master key', because it does not exist or you ... You might try changing the service account using the SQL Server Configuration Manager tool as this will regenerate the service master key. ...
    (microsoft.public.sqlserver.security)
  • Re: Managing SQL Encryption -- Is there a Best Practice Doc?
    ... installed not when the Database Master Key is created. ... The Service Master Key is created when the instance of SQL Server is ... encryption to have the same Service Master Key? ...
    (microsoft.public.sqlserver.security)