Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

lua use resty.aes Encrypted hex result diff from c++ use openssl

オープン
#20 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp, lua

調査の方向性

resty.aes の暗号化エントリーポイントと、示されている C++ の EVP_BytesToKey 呼び出しから始め、次に例におけるキー、salt、cipher、hash、rounds、hex 出力を比較してください。両方の結果を再現し、その差異について maintainer が確認した説明を文書化してください。issue ではリポジトリのファイルもテストも指定されていません。

索引モデルが issue の本文から書いたものです。

説明

the same key and the same mesg, but the result is different, why?
lua:
local key = "1"
local mesg = "2"

local aes_256_cbc_sha1x5 = aes:new(key, salt, aes.cipher(256,"cbc"), aes.hash.sha1, 5)
local encrypted = aes_256_cbc_sha1x5:encrypt(mesg)
ngx.say("AES 256 CBC (SHA-1, salted) Encrypted HEX: ", str.to_hex(encrypted))

AES 256 CBC (SHA-1, salted) Encrypted HEX: 619a1da54b6c5113eb335a74296fed54

c++:
int i, nrounds = 5;
unsigned char key[32], iv[32];

i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), NULL, key_data, key_data_len, nrounds, key, iv);

...
hex:1671d15e1905d518201b35064043cb71

to_hex api invoke ngx_hex_dump, it developed by C , same to my own c++ coding, but the result's display is different, Why???

主要言語
Lua
スター
443
フォーク
143
平均マージ
2時間 31分
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openresty/lua-resty-string のほかの issue

openresty/lua-resty-string の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。