eCryptfs - same plain files generates different encrypted files

163 Views Asked by At

is there a way how to configure eCryptfs to produce same encrypted content for the same content of plain text files. I understand that could be a security risk, but I have a specific case.

Example:

$ md5sum *
09f7e02f1290be211da707a266f153b3  file1.txt
09f7e02f1290be211da707a266f153b3  file2.txt


$ md5sum ../.secret/*
c0de3fb13ce02e577b6f2373698f783e  ../.secret/ECRYPTFS_FNEK_ENCRYPTED.FWayVrRYlN446EY.WUc7GBFqG9GB6qF3eRmJizqFyT5znWxQ3YMUMxK4NU--
9b71d5233c9cd8a7281760dff5188aa8  ../.secret/ECRYPTFS_FNEK_ENCRYPTED.FWayVrRYlN446EY.WUc7GBFqG9GB6qF3eRmJtuU9knoUTV6Jb16QlIHG7U--

Thanks M.

2

There are 2 best solutions below

0
On

I assume it is not possible, however my motivation was little bit different and I know the solution for my case.

My case is following: let's have a plain file file1.txt and its encrypted mirror file1_enc.txt. I'm going to distribute file1_enc.txt. I want to have the same (binary identical) file file1_enc.txt for the same file1.txt.

To achieve it, we have to start with initial mount containing the file1.txt and then replace the file. In this scenario it is ensured that same file1.txt produces same file1_enc.txt.

In other words if I start new mount with no files and copy file1.txt, different file1_enc.txt will be produced.

0
On

I'm sorry, there just is not going to be a way to have the same plaintext file produce identical ciphertext. If this were possible it would be an indication of a faulty cryptographic algorithm.