-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCryptMe.php
26 lines (26 loc) · 868 Bytes
/
CryptMe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
class CryptMe{
private $api = "https://api.ineo-team.ir/CryptMe.php";
public function encode($input, $password = null){
$cURL = curl_init($this->api);
curl_setopt_array($cURL, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => ['action' => "encode", 'input' => $input, 'password' => $password],
CURLOPT_CUSTOMREQUEST => 'POST',
]);
$output = json_decode(curl_exec($cURL),true);
curl_close($cURL);
return $output['result']['output'];
}
public function decode($input, $password = null){
$cURL = curl_init($this->api);
curl_setopt_array($cURL, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => ['action' => "decode", 'input' => $input, 'password' => $password],
CURLOPT_CUSTOMREQUEST => 'POST',
]);
$output = json_decode(curl_exec($cURL),true);
curl_close($cURL);
return $output['result']['output'];
}
}