+ openssl_public_encrypt($v, $ciphertext, $pub_key);
+ return $ciphertext;
+ }
+
+ function decrypt($v)
+ {
+ $key_dir = "{$this->getKeyDirectory()}/pri.key";
+
+ if(!file_exists($key_dir)) {
+ print_r("Cannot find {$key_dir}");
+ exit;
+ }
+
+ $pri_key = file_get_contents($key_dir);
+ if(!$pri_key) {
+ return;
+ }
+
+ openssl_private_decrypt($v, $plaintext, $pri_key);
+ return $plaintext;