The benefit of this approach is simple: The original passphrase can't be brute-forced from only the encrypted result without trying all the recusrive encryptions and knowing how many recusion levels were used during encryption.
echo hello | red e world | tee hello-world.enc.txt | red d world
Now the hello-world.enc.txt
file is "hello
" encrypted recursively using sha512-recursive digests of the "world
" passphrase.
echo hello | red e world 3
results in essentially:
hello-world.enc.txt = e(e(e("hello",sha("world")),sha(sha("world"))),sha(sha(sha("world"))))
which can be decrypted using:
cat hello-world.enc.txt | red d world 3
results in essentially:
"hello" = d(d(d(hello-world.enc.txt,sha(sha(sha("world")))),sha(sha("world"))),sha("world"))
This technique is strengthened further by changing the cipher algorithms based on the passphrase. It feels kinda like salting each iteration.