Need Lua Client that makes requests with HTTP API and encrypts/decrypts with AES-256
Budget: $30 – $250 USD
Hello, I own an authentication API and a customer of mine needs a Lua API wrapper, an example of how to communicate with my API in Lua. It needs to be able to send POST HTTP requests and decode the JSON response, as well as encrypting the requests and decrypting the responses.
I have an API wrapper in C# if that would be of any help for reference https://github.com/KeyAuth/KeyAuth-CSHARP-Example. The encryption is a string encrypted with AES-256-CBC OpenSSL encryption which is then hex encoded. The encryption key is a string that is hashed with sha256 and then trimmed to 32 characters. The encryption iv is a random GUID that is hashed with sha256 and then trimmed to 16 characters. In the first function, init, the string secret is passed into the place of the encryption key. In all the other requests, the string enckey is used, which is a sha256 hashed GUID.
Here's the PHP code of the encrypt and decrypt functions as well, they may be more simple to look at than the C# encrypt functions https://pastebin.com/cu0qfQGN
So, I'm looking for a Lua script with the same functionality of the c# API wrapper I sent above, https://github.com/KeyAuth/KeyAuth-CSHARP-Example. Let me know if you need me to elaborate on anything. Here's an image of the response returned from my API https://cdn.discordapp.com/attachments/811787400044085280/857057473466990613/unknown.png. It is returned in that same format with the success bool and the message string for every request. Here is an example of the response for the login function https://pastebin.com/zjRwgB5n. If possible, it would be great if the username was read into a string like the c# API wrapper so that customers of mine could print out the username if they wanted. i.e. so that they could do "hello username!". Lastly, here is an example from the download function https://pastebin.com/erBntrBQ. The contents object is hex encoded and must be decoded and then converted to a byte array.
Hope someone is up for doing this, more than willing to elaborate if needed.
I have an API wrapper in C# if that would be of any help for reference https://github.com/KeyAuth/KeyAuth-CSHARP-Example. The encryption is a string encrypted with AES-256-CBC OpenSSL encryption which is then hex encoded. The encryption key is a string that is hashed with sha256 and then trimmed to 32 characters. The encryption iv is a random GUID that is hashed with sha256 and then trimmed to 16 characters. In the first function, init, the string secret is passed into the place of the encryption key. In all the other requests, the string enckey is used, which is a sha256 hashed GUID.
Here's the PHP code of the encrypt and decrypt functions as well, they may be more simple to look at than the C# encrypt functions https://pastebin.com/cu0qfQGN
So, I'm looking for a Lua script with the same functionality of the c# API wrapper I sent above, https://github.com/KeyAuth/KeyAuth-CSHARP-Example. Let me know if you need me to elaborate on anything. Here's an image of the response returned from my API https://cdn.discordapp.com/attachments/811787400044085280/857057473466990613/unknown.png. It is returned in that same format with the success bool and the message string for every request. Here is an example of the response for the login function https://pastebin.com/zjRwgB5n. If possible, it would be great if the username was read into a string like the c# API wrapper so that customers of mine could print out the username if they wanted. i.e. so that they could do "hello username!". Lastly, here is an example from the download function https://pastebin.com/erBntrBQ. The contents object is hex encoded and must be decoded and then converted to a byte array.
Hope someone is up for doing this, more than willing to elaborate if needed.
Related categories:
Lua