🔐 在线加解密API

安全、快速、可靠的在线 数据加密解密 API 平台 【永久无限制免费使用】

🔒 加密
🔓 解密
📦 批量处理
🛠️ 工具
📖 API文档

🔧 加密设置

🔒 数据加密

0 字符 0 字节

正在加密中...

✅ 加密结果

原始长度: -
加密长度: -
处理时间: -
使用算法: -

🔓 数据解密

0 字符 格式未验证

正在解密中...

✅ 解密结果

加密长度: -
解密长度: -
处理时间: -

📦 批量处理

支持批量加密或解密多个文本项目

0 行

正在处理中...

📊 批量处理结果

总项目: -
成功: -
失败: -
总耗时: -

🔍 数据验证

验证加密数据的格式和完整性

⚡ 性能测试

测试加密解密性能

🎲 密码生成器

生成安全的随机密码

📊 系统信息

查看API状态和系统信息

🚀 加密API文档

高性能数据加密解密服务,支持多种算法和安全特性

🌐

API端点

jiami/api.php
📋

支持方法

POST / GET
🔒

数据格式

JSON

📚 API接口

POST

🔒 数据加密

将明文数据加密为Base64密文

text password cipher hashAlgo
POST

🔓 数据解密

将Base64密文解密为明文数据

encrypted password
POST

🔍 数据验证

验证加密数据格式是否正确

encrypted
POST

⚡ 性能测试

测试加密解密性能表现

iterations testData
POST

📋 算法列表

获取支持的加密和哈希算法

无需参数
POST

🔐 哈希算法

获取支持的哈希算法列表

无需参数

💡 使用示例

cURL 示例
# 加密数据
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"
  }'
JavaScript 示例
// 加密数据
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);
PHP 示例
 '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传输

生产环境必须使用HTTPS协议保护数据传输

🚫

输入验证

对所有用户输入进行严格的格式和长度验证

🔄

密钥轮换

定期更换加密密钥,提高系统安全性