how to implement aes-128-ecb encryption with php or golang
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- cryptography
Research direction
Start by comparing the shown resty.aes configuration with the PHP openssl_encrypt call, including the AES mode, key, padding, and base64 handling. Reproduce both outputs and determine whether the differing ciphertext is caused by mismatched options; done means documenting the equivalent configuration or the remaining incompatibility.
Written by the indexing model from the issue text.
Description
here is the lua code
local aes = require 'resty.aes'
local cipher = aes:new('0123456789123456', nil, aes.cipher(128, 'ecb'))
print(ngx.encode_base64(cipher:encrypt('foobar')))
the output should be rTeNAHEZtzsyn1dDAujGgQ==
blow is my php code
var_dump(base64_encode(openssl_encrypt('foobar', 'aes-128-ecb', '0123456789123456', OPENSSL_RAW_DATA)));
the output should be AIIiZT3RO/bkseLE0Mcopg==
how can i get the lua result with php code. pls help me, thanks.
- Dominant language
- Lua
- Stars
- 443
- Forks
- 143
- Avg merge
- 2h 31m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openresty/lua-resty-string
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
openresty/lua-resty-string#109 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
openresty/lua-resty-string#92 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
openresty/lua-resty-string#91 · 4 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
openresty/lua-resty-string#90 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
All issues in openresty/lua-resty-string
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
api7/lua-resty-saml#62 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nvim-tree/nvim-tree.lua#3357 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
codymikol/multiverse.nvim#320 ·
-
Data Correction tbc
Difficulty 2/5 1-3 hours Newbie friendliness 68/100