Skip to content

Instantly share code, notes, and snippets.

View abiriadev's full-sized avatar

Abiria abiriadev

View GitHub Profile

problem:

  1. $f$는 one-way function이다.
  2. $g(x_1, x_2) = (f(x_1), x_2)$ where $|x_1| = |x_2|$.

$g$가 one-way function임을 보여라.

proof.

$f$가 one-way function이라면, $x$에 대해 $(f(x), |x|)$를 받았을 때 $f(x') = f(x)$를 만족시키는 $x'$을 non-negligible한 확률로 구해내는 adversary $\mathcal A$는 존재하지 않는다.

$p = 11$의 유한체 위로 가정한다.

where $v = 2$

$\mathbb B^2$를 2차원 binary hypercube라고 하자. $\mathbb B$의 모든 원소에 대해 아래 함숫값들은 알려져 있다.

$$\begin{aligned} f(0, 0) &= 3 \ f(0, 1) &= 4 \ f(1, 0) &= 1 \

가정에서 언급되는 key-recovery attack을 구현한 adversary를 $\mathcal A$라고 하자. $\mathcal A$에게 $F_k$의 oracle access를 주면 $n$번의 시행 후 키 $k$를 반환한다.

이제 이 $\mathcal A$를 사용해 distinguisher $D$를 구성한다. $D$는 우선 $\mathcal A$에게 oracle $\mathcal O$를 넘겨주고, $k$를 먼저 받는다. 이후 $x \in \{ 0, 1 \}^n$를 골라 $\mathcal O(x) = F_k(x)$라면 $1$을 반환한다.

$$\left|P(D^{F_k}(1^n) = 1) - P(D^f(1^n) = 1)\right| \leq {\rm negl}(n)$$

$D$가 위 수식을 만족하면 $F_k$는 pseudorandom permutation이다. 위에서 구성한 $D$를 사용하면 좌변은 $1$이 되고, 우변은 $\dfrac1{n!}$이 된다. 이는 negligible하지 않으므로, $F_k$는 pseudorandom permutation이 아니다.

@abiriadev
abiriadev / 6.19.md
Last active September 17, 2025 10:09

(a)

우선, $({\rm Gen}_H,{\cal MT}_t)$에 대해 다음과 같은 실험 $\text{MT-coll}_{\mathcal A,({\rm Gen}_H,{\cal MT}_t)}(n)$ 을 정의한다:

  1. 키를 $s \gets {\rm Gen}_H(1^n)$ 로 생성한다.
  2. adversary $\mathcal A$$s$를 받고 $(x_1, x_2, x_3, \dots, x_t)$$(x'_1, x'_2, x'_3, \dots, x'_t)$를 반환한다.
  3. 실험의 결과는 ${\cal MT}^s(x_1, x_2, x_3, \dots, x_t) = {\cal MT}^s(x'_1, x'_2, x'_3, \dots, x'_t)$인 경우 1로 정의된다.

모든 PPT adversary $\mathcal A$에 대해 다음을 만족하는 negligible한 함수 ${\rm negl}$이 항상 존재한다면, $({\rm Gen}_H,{\cal MT}_t)$는 collision-resistant하다.

const n = 10, s = 10
const x = s * n, m = s ** n
const dp = Array(n).fill(0).map(() => Array(x))
const ij = (i, j) => (i === -1 && j === -1 ? 1 : dp[i]?.[j] ?? 0)
for (let i = 0; i < n; ++i)
for (let j = i; j < x; ++j)
dp[i][j] = ij(i, j - 1) + ij(i - 1, j - 1) - ij(i - 1, j - (s + 1))
{
"result": {
"articleList": [
{
"type": "ARTICLE",
"item": {
"articleId": 20638012,
"cafeId": 27842958,
"refArticleId": 20638012,
"replyArticleCount": 0,
const History = require('../schemas/history')
const { HistoryTypes } = require('../utils/types')
const editTypeKeys = ['Create', 'Modify', 'Delete', 'Move', 'ACL', 'Revert']
const rangeMap = {
all: '전체',
'1m': '1달',
'2w': '2주',
'1w': '1주',
@abiriadev
abiriadev / allow-empty-message.patch
Created March 25, 2025 13:06
force git to allow empty commit message. it's just a hacky joke with experiment. use it on your own risk in production
diff --git a/builtin/commit.c b/builtin/commit.c
index 2f45968222..25e26a2f70 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -125,7 +125,7 @@ static int all, also, interactive, patch_interactive, only, amend, signoff;
static int edit_flag = -1; /* unspecified */
static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
static int config_commit_verbose = -1; /* unspecified */
-static int no_post_rewrite, allow_empty_message, pathspec_file_nul;
+static int no_post_rewrite, allow_empty_message = 1, pathspec_file_nul;
{"name":"비바리퍼블리카","logo":"sPAYpdVUuc5f6Igt"}
{"name":"두나무","logo":"3k6PqerQxnSt1u1y"}
{"name":"컬리","logo":"zZ3N7smS7Hb109Ba"}
{"name":"눔","logo":"3dwCV7p9l4LHFAot"}
{"name":"야놀자","logo":"8MDKWmQf2WnI4TZh"}
{"name":"보타메디","logo":"XzZH7b8liBLYzDL1"}
{"name":"라이온하트스튜디오","logo":"StXDHWhZIQeH9x3W"}
{"name":"메가존클라우드","logo":"GBw68jR5VoRdYsRk"}
{"name":"포티투닷","logo":"iJ0k1lsG61sx1ZKO"}
{"name":"더블유컨셉코리아","logo":"a2dxJfGBzjNNcIHn"}