Function missing to convert stored hex value back to Ascii for decrypt function
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- lua
- 領域
- cryptography
調査の方向性
まず、リポジトリに既存する hex 変換および復号関数を調査し、次に、それらが想定する入力を issue に示されている保存値のフローと比較します。文書化された API または復号動作によって、hex エンコードされた暗号化値を一貫して変換または復号できるようになれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The functions you have are very good, but they make the assumption that if you want to encrypt and decrypt you will always have the encrypted ascii value (non-converted around). If you have to store this value into a cache table or dictionary there is no existing function (aside from atoi) to convert it back to something the decrypt function will take. So, there are two options:
- provide a new function to convert any stored value back to ascii
- change the decrypt function to handle hex and other data primitives
The code that I have had to use to invoke decrypt from a stored value. cache_key is supplied by an OS envvar.
local cache_key = os.getenv("ENCRYPT_KEY");
-- hex to char conversion, used to perform substitution
local c_table = {};
for jj = 0, 255 do
c_table[("%02X"):format(jj)] = string.char(jj);
c_table[("%02x"):format(jj)] = string.char(jj);
end
-- decryptIt function
local function decryptIt(value)
local aes_128_cbc_md5 = aes:new(cache_key);
return aes_128_cbc_md5:decrypt(value);
end
-- convert to ascii
local function convertAscii(value)
return value:gsub("(..)", c_table);
end
local value = encryptIt(init_value);
.
.
ngx.header['Set-Cookie'] = { "hash_val=" .. str.to_hex(value) .. }
.
. ( a lot of code and reinvoke of proxy, etc... )
.
local url = ngx.var['cookie_hash_val'];
local d_crypted = decryptIt(convertAscii(url));
I think I have the above correct, but if you have any questions let me know.
- 主要言語
- Lua
- スター
- 445
- フォーク
- 144
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openresty/lua-resty-string のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
openresty/lua-resty-string#109 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
openresty/lua-resty-string#95 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
openresty/lua-resty-string#92 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
openresty/lua-resty-string#91 · コメント 4 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
openresty/lua-resty-string#90 · コメント 1 件 ·
openresty/lua-resty-string の issue をすべて見る
似ている issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eugenioenko/ttt#919 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Profiler (Remotery) leaks a socket for every connection that fails the WebSocket handshake対応中かも @rthery が今日担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
koreader/koreader#16242 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Mosquito: LOOP_ANT_LOCK reads the IFF detonator cover対応中かも @cbass2404 が今日担当しました。 オープンMosquito
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
DCS-Skunkworks/dcs-bios#1925 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 80/100
mason-org/mason.nvim#2117 ·