mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-18 01:36:40 +08:00
更新文件
This commit is contained in:
parent
f62d4cd103
commit
e9f64988a9
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
header('content-type: application/json; charset=utf-8');
|
|
||||||
$path = '../runtime/order.json';
|
|
||||||
if (!file_exists($path)) {
|
|
||||||
exit('{"code":3,"msg":"文件不存在"}');
|
|
||||||
} else {
|
|
||||||
exit(file_get_contents($path));
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
function encrypt($string, $key) {
|
|
||||||
$method = "AES-256-CBC";
|
|
||||||
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method));
|
|
||||||
$encrypted = openssl_encrypt($string, $method, $key, 0, $iv);
|
|
||||||
// 将iv和加密字符串拼接起来
|
|
||||||
return base64_encode($iv . $encrypted);
|
|
||||||
}
|
|
||||||
|
|
||||||
$key = "your-encryption-key"; // 这里应该是一个安全的密钥
|
|
||||||
$string = "Hello, World!";
|
|
||||||
$encryptedString = encrypt($string, $key);
|
|
||||||
|
|
||||||
echo $encryptedString; // 输出加密字符串
|
|
Loading…
Reference in New Issue
Block a user