paragonie / ciphersweet

Fast, searchable field-level encryption for PHP projects
https://ciphersweet.paragonie.com
Other
437 stars 32 forks source link

Fixing FileProvider for read key from kubernetes secret file #94

Open gawsoftpl opened 1 year ago

gawsoftpl commented 1 year ago

There was a issue for Kubernetes secrets: I saved key in file as string not binary file.

Kubernetes save secrets without whitelines and converted string to binary

For that situation I have error: Invalid ciphertext because script read string file as binary and do not convert them from string(hex2bin) and do not remove whitespaces.

  1. I moved string convert function to Util class
  2. I wrote unit tests for binary, string files with key
  3. I add new logic for getSymmetricKey in FileProvider