fsspec / fsspec/s3fs

How to use SSEC encrytption?

Open
#607 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
305
Avg merge
22h 37m
Merged PRs (30d)
4

Description

I'm trying to use the SSECustomerKey parameter to encrypt a file using SSEC mode in a minio server, but I'm encountering an error, can anyone help me?

This is my code:

fs = s3fs.S3FileSystem(key='xxx' secret='xxx', client_kwargs={'endpoint_url': 'https://xxx', 'region_name': 'internal', 'verify': False}, s3_additional_kwargs={'SSECustomerAlgorithm': 'AES256', 'SSECustomerKey': 'xxxx'})

with fs.open('test/test.txt', 'wb') as f:
    f.write(b'test')

image

On the SSECustomerKey parameter, I tried using raw 32-bit strings, 32-bit binary files(os.urandom(32)), and base64 strings, but only got the same error.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Python example using fs.open and the SSEC parameters shown in the issue. Review the attached error screenshots and compare the behavior for the raw, binary, and base64 key forms described. Done means identifying the cause and documenting a verified way to write the encrypted file, or clearly recording that the requested usage is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.