Overview
You can use the COS console to encrypt the objects stored in buckets to prevent data leakage.
Note:
- As long as you have access permission on an object, your object-accessing experience is the same regardless of whether the object is encrypted.
- Server-side encryption encrypts only the object data but not its metadata. Server-side encrypted objects can only be accessed with a valid signature and cannot be accessed by anonymous users.
- When you list objects in a bucket, all objects will be listed, regardless of whether they are encrypted.
Operation Steps
- Log in to the COS console.
- In the left sidebar, click Bucket List, and go to the bucket list page.
- Find the bucket where the object is located and click the bucket name to enter the bucket management page.
- In the left sidebar, select File List to go to the file list page.
- Find the object you want to set encryption on and click Details on the right operation column.
- In the Server-Side Encryption area, click Modify.
- Select the corresponding encryption method and click Save.
Currently, the following two encryption methods are supported:- SSE-COS: Server-side encryption with COS-managed keys.
- SSE-KMS: Server-side encryption with a key managed by KMS. You can choose to use the default key or create a key.
Note:
SSE-C encryption is server-side encryption with a custom key. The encryption key is provided by the user. When the user uploads the object, COS will use the encryption key provided by the user to encrypt the user's data by AES-256. (SSE-C can only be used via API and does not support console operations)
Example: Using Server Encryption SSE-C
Request
PUT /exampleobject HTTP/1.1
Host: <bucketname-appid>.<Endpoint>
Date: Fri, 10 Apr 2020 09:36:12 GMT
Content-Type: image/jpeg
x-cos-server-side-encryption-customer-algorithm: AES256
x-cos-server-side-encryption-customer-key: MDEyMzQ1Njc4OUFCQ0RFRjAxMjM0NTY3ODlBQkNERUY=
x-cos-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==
Content-Length: 16
Content-MD5: 7o3pGNBWQBRbGPcPTDqmAg==
Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1586511372;1586518572&q-key-time=1586511372;1586518572&q-header-list=content-length;content-md5;content-type;date;host;x-cos-server-side-encryption-customer-algorithm;x-cos-server-side-encryption-customer-key;x-cos-server-side-encryption-customer-key-md5&q-url-param-list=&q-signature=4f6f9f0a6700930f70bff31e3a2b2e622711****
Connection: close
Response
HTTP/1.1 200 OK
Content-Length: 0
Connection: close
Date: Fri, 10 Apr 2020 09:36:13 GMT
ETag: "582d9105f71525f3c161984bc005efb5"
x-cos-hash-crc64ecma: 16749565679157681890
x-cos-request-id: NWU5MDNlMGNfZTFjODJhMDlfMzVlMDFfZTk1****
x-cos-server-side-encryption-customer-algorithm: AES256
x-cos-server-side-encryption-customer-key-MD5: U5L61r7jcwdNvT7frmUG8g==