in reply to File::Slurp and encryption
Try using the binmode => ':raw' option for read_file (if it's not text) and write_file (if crypt can return any byte).
Any benefit from slurping should be minimal (and null when using Big-Oh notation). You'll get real time savings by switching from the Perl version of the cypher to a C version.
In Section
Seekers of Perl Wisdom