安全、快速、可靠的在线 数据加密解密 API 平台 【永久无限制免费使用】
正在加密中...
正在解密中...
支持批量加密或解密多个文本项目
正在处理中...
验证加密数据的格式和完整性
测试加密解密性能
生成安全的随机密码
查看API状态和系统信息
高性能数据加密解密服务,支持多种算法和安全特性
jiami/api.php
                            将明文数据加密为Base64密文
将Base64密文解密为明文数据
验证加密数据格式是否正确
测试加密解密性能表现
获取支持的加密和哈希算法
获取支持的哈希算法列表
# 加密数据
curl -X POST https://hpsocket.cn/jiami/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "action": "encrypt",
    "text": "Hello World!",
    "password": "myPassword"
  }'
# 解密数据
curl -X POST https://hpsocket.cn/jiami/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "action": "decrypt",
    "encrypted": "eyJjaXBoZXI...",
    "password": "myPassword"
  }'// 加密数据
async function encrypt(text, password) {
  const response = await fetch('https://hpsocket.cn/jiami/api.php', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      action: 'encrypt',
      text: text,
      password: password
    })
  });
  return await response.json();
}
// 解密数据
async function decrypt(encrypted, password) {
  const response = await fetch('https://hpsocket.cn/jiami/api.php', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      action: 'decrypt',
      encrypted: encrypted,
      password: password
    })
  });
  return await response.json();
}
// 使用示例
const result = await encrypt('Hello World!', 'myPassword');
console.log(result.data.encrypted); 'encrypt',
        'text' => $text,
        'password' => $password
    ]);
    
    $ch = curl_init('https://hpsocket.cn/jiami/api.php');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    return json_decode($response, true);
}
// 使用示例
$result = encryptData('Hello World!', 'myPassword');
echo $result['data']['encrypted'];
?>{
  "success": true,
  "message": "操作成功",
  "data": { /* 具体数据 */ },
  "timestamp": 1640995200,
  "version": "2.0"
}{
  "success": false,
  "message": "错误描述",
  "error": "ERROR_CODE",
  "timestamp": 1640995200,
  "version": "2.0"
}使用复杂密码,包含大小写字母、数字和特殊字符
生产环境必须使用HTTPS协议保护数据传输
对所有用户输入进行严格的格式和长度验证
定期更换加密密钥,提高系统安全性