I was asked to create a mechanism to dump a (data on rest) encrypted mysql into an encrypted file. That mechanism must meet certain criteria, like:
- Shall run under Linux
- No write of unencrypted sql data, not even into temporary files
- Generating of a md5 (or other hash) of the unencrypted dump stream
- No use of process substitution since only sh shell is available
I would need something like that:
mysqldump | md5-tool >> dump.md5 | gzip | encryption-tool
My problem is that all hashing tools that I was able to find don't transport the stream, but only the checksum. The tool that comes closest is the BSD md5 with the -p
option, but that is not available on Linux.
Does anyone know a tool with that this can accomplished?
zstd
compresses about as well but something like 5x faster on a single core, and its standard tool has options to use multiple cores.