如何快速使文本文件对人类不可读?

Ala*_*air 0 php string obfuscation encoding

我想以最快的方式对文本文件进行编码,只是让人类无法读取.

也许可以翻转每个字节的第一位,或者可以非常快速地完成某些操作,这样就不会减慢脚本的速度.文本文件的长度将是几MB,因此无论哪种方法都可以使其无法读取.

mea*_*gar 5

通过ROT13的单次传递丢弃内容.

file_put_contents($filename, str_rot13(file_get_contents($filename));
Run Code Online (Sandbox Code Playgroud)

或者,通过base64_encode:

file_put_contents($filename, base64_encode(file_get_contents($filename));
Run Code Online (Sandbox Code Playgroud)

快速测试告诉我速度没有显着差异.