고객 데이터가 관련되어 있으므로 실제로이 문제를보고 싶습니다.GNUPG shell_exec에서 에코 된 데이터를 이스케이프 처리합니다.
나는 공유 호스팅을 사용하고 있기 때문에 명령 줄을 통해 GNUPG를 사용하고 있으며 PHP 클래스를 사용할 수 없습니다.
putenv("GNUPGHOME=/home/me/.gnupg");
$gpg = '/usr/bin/gpg';
$gpgrecipient = 'email';
$mailrecp = 'email';
$plain = 'Here is the encrypted Text Here is the encrypted Text Here is the
encrypted Text Here is the encrypted Text Here is the encrypted Text Here is the
encrypted Text Here is the encrypted Text Here is the encrypted Text Here is the
encrypted Text';
$encrypted = shell_exec("echo {$plain} | {$gpg} --no-auto-check-trustdb --lock-never -e -a -r {$gpgrecipient} ");
그래서, 어떻게 데이터 무결성을 유지하면서, $plain
을 탈출 가야합니까 다음과 같이 그래서 내 코드는?
escapeshellcmd()
을 사용하면 형식이 엉망입니다.
공유 호스팅의 중요한 데이터이기 때문에 파일에 아무것도 저장하지 않으려 고합니다.
저는 proc_open을 사용하지 않았습니다. 파이핑하는 방법이 훨씬 복잡해 보이지만 잘하면 알 수 있습니다. 정보 주셔서 감사합니다! – Ben