C.W.K.
Stream
Lesson 01 of 05 · published

수학 — 4자리 PIN 이 방어 가능한 이유

~15 min · bcrypt, math, pin-length

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

4자리 PIN 은 1만 조합. 종이상으론 trivially 깨져. 실전에선 두 개 합쳐지는 방어로 솔로 앱한테 가장 비용 효과적인 auth 선택 중 하나가 돼. 수학은 한 번 해볼 가치 있어.

Brute force 세 모드

모드속도물리치는 법
Offline (hash leak)SHA256: ~10⁹ 추측/초/GPU → 4자리는 microsecondBcrypt cost 12: ~6 추측/초/코어 → 4자리 ~30분
Online, lockout 없음HTTP 요청 속도 — Tailscale 통해 ~100/초 → 4자리 ~2분Rate limit + lockout (이 트랙)
Online, lockout-after-55회 시도 후 blacklist → opportunistic 공격자한텐 사실상 못 깸이게 목표

5자리가 사주는 거

PIN 길이조합UX 비용marginal 보안 이득 (lockout 있을 때)
410,000baseline (빠름)baseline
5100,000+키 한 번online 10x; bcrypt cost 12 에서 offline 미미
61,000,000+키 두 번100x; lockout 실패할 때만 의미
8100,000,000+키 네 번; 사람들 더듬거리기 시작이 시점부터 diminishing returns

External links

Exercise

Dev 머신에서 python -c "import bcrypt; bcrypt.hashpw(b'1234', bcrypt.gensalt(rounds=12))" 시간 측정. wall-clock 시간이 추측당 비용. 1만 곱해 — hash leak 시 4자리 PIN 의 대략적 offline 크랙 시간. 하드웨어한테 cost factor 가 맞는지 결정.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.