I am having some troubles with decrypting zip archive via openssl in php.
Thats how i encrypt it with my public key.
public function encrypt($data) {
openssl_public_encrypt($data, $encrypted, $this->pubKey);
return chunk_split(base64_encode($encrypted));
}
Encryption output looks like this:
T5Nu3gGqCnwFhBoctx0D1bOvrBg9VfKNJaVz5RSu4OBsKI2qBdw1sZ4YQNC8ya3xU/tvpcTtw/vd LKZeKaFZloPP49hu9uRX7+rJYegVHHLKBdP0JX380mmJCq+4kj1R3gt4l4zzBGuvEZMQnSffOgdR hdao0DcSU0R2feOKkyuIy9NVxtmX9iXVGmOalyy0s4azk9mD5KnHcKIYgJG7YCyAr97lX6A7MKMi xq9/hpvLhdQa5cZH6f1eXoIFx9uRSIaKdeKmZzHPVUPOVnqlHQuhtUE+Of/RnWYYKoS280TUROKV fk7jepF+w3wxQ1yrYLDPyglWBCjyaHQbdDTB7w==
Then I am trying to decrypt my zip archive back.
public function decrypt($data) {
openssl_private_decrypt(base64_decode($data), $out, $this->prvKey);
return $out;
}
I am just getting path of zip archive, something like
C:\OpenServer\domains\project\src\AppBundle\Command/../../../backup/2016_04_05_full.zip
How should i decrypt encrypted zip archive file?
thanks!