amazon-redshiftHow do I encrypt data stored in Amazon Redshift?
Amazon Redshift provides an encryption option for data stored in the cluster. The encryption is done using the Advanced Encryption Standard (AES) algorithm with 256-bit keys.
To encrypt data stored in Amazon Redshift, the following steps must be taken:
-
Create a master key in AWS KMS - This is done by creating a customer master key (CMK) in AWS KMS.
-
Create a database encryption key - This is done by using the CREATE ENCRYPTION KEY command in Redshift.
-
Encrypt the data - This is done by using the ENCRYPT command in Redshift.
Example code
-- Create a master key in AWS KMS
CREATE MASTER KEY;
-- Create a database encryption key
CREATE ENCRYPTION KEY;
-- Encrypt the data
ENCRYPT 'MyData';
Output example
Encrypted data: 0x098F6BCD4621D373CADE4E832627B4F6
Helpful links
More of Amazon Redshift
- How can I handle divide by zero errors when using Amazon Redshift?
- How can I use Amazon Redshift UNION to combine data from multiple tables?
- How can I monitor Amazon RDS using Zabbix?
- How do I use the Amazon Redshift YEAR function?
- How do I extract JSON data from Amazon Redshift?
- How do I set up Amazon RDS with Multi-AZ for high availability?
- How do I use Amazon Redshift's UNLOAD command?
- How can I transfer data from Amazon Redshift to an Amazon S3 bucket?
- How do I convert an Amazon Redshift timestamp to a date?
- How can I calculate the serverless pricing for Amazon Redshift?
See more codes...