I'm writing a bash script to automate the decryption of a certain file; however the file is encrypted in 16 byte blocks, rather than simply encoded in its entirety.
Here's some psuedo code to briefly explain why I'm trying to do:
cat encrypted.bin | \
buffer and output 16 bytes when asked | \
openssl --args >> decrypted.bin
I essentially need the pipe to open and close in order to split up the data, and am unsure of how this could be done in bash. I've looked at split
, but since the encrypted file could be several GBs, I don't want to perform that many disk writes.
I should also point out that I'd like to know if there's a way to do this without looping through multiple pipes.
split -b 16
also.