bluppy2·vor 15 Jahren·discussSince the RSA algorithm for public/private key algorithm can only encrypt payloads as large as the (public)key, this is the only way to safely encrypt files.That's why PHP provides the openssl_seal function can do exactly the same (and more) as the given code. (http://php.net/manual/en/function.openssl-seal.php)When you Google for it there are also implementations for other languages available.