在 Lua 中加密字符串,然后在 PHP 中解密?

我试图寻找一种在 PHP 和 Lua 中创建函数的方法(没有结果),其中你可以在 Lua 中对字符串进行哈希/加密(然后将其作为 Post 请求发送到我的域),然后在 PHP 中解密已经哈希/加密的字符串,任何帮助都将不胜感激。

例如 Lua:

    local string = "Hello World"
    local encrypted = encrypt(string)
    api:HttpPost("my.website.com/php", encrypted)

例如. PHP:

   <?php
   $input = file_get_contents("php://input");
   $unhashed = $unhash(input);
   echo($unhashed);
   ?>

然后它将回显“Hello World”,有人知道怎么做吗?

点赞