해시/암호화
Scrypt Hash + Verify
scrypt로 비밀번호를 해시화합니다(RFC 7914, 메모리 집약형 KDF), 기존 해시와의 대조 검증 포함.
Scrypt (RFC 7914) was one of the first memory-hard password-hashing algorithms: it deliberately requires a lot of RAM, not just CPU time, to make parallel brute-forcing on GPUs and ASICs harder.
How to use it
- Hash: enter a password and tune the parameters (N — memory cost, r — block size, p — parallelism) to get a hash.
- Verify: paste a password and an existing scrypt hash to check whether they match.
- Every hash uses a fresh random salt, so the same password produces a different hash each time.
Common uses
- Checking that a backend correctly hashes passwords with scrypt before storing them.
- Generating a test scrypt hash for fixtures or seed data during development.
- Comparing scrypt against bcrypt and Argon2 when choosing a hashing algorithm for a new project.
Things to keep in mind
The N parameter (memory cost) increases both required memory and compute time exponentially — tune it to your server's actual capacity.
Scrypt has been superseded by Argon2 (the official Password Hashing Competition winner) as the recommended choice for new systems, though scrypt itself still isn't considered unsafe.
자주 묻는 질문
scrypt는 bcrypt나 PBKDF2와 어떻게 다른가요?
Scrypt는 의도적으로 메모리 집약적이면서 CPU 집약적이기도 해서, 주로 CPU 기반 브루트포스에만 저항하는 bcrypt나 PBKDF2에 비해 GPU나 맞춤형 ASIC 하드웨어로 크랙하는 비용이 훨씬 높습니다.
N, r, p 매개변수는 무엇을 제어하나요?
N은 CPU/메모리 비용을 설정하고(2의 거듭제곱이어야 함), r은 연산당 메모리 사용에 영향을 주는 블록 크기를 설정하며, p는 병렬성을 설정합니다 — 이 중 하나라도 늘리면 정당한 사용과 공격 모두에 대한 자원 비용이 증가합니다.
Argon2에 비해 scrypt는 여전히 좋은 선택인가요?
Scrypt는 여전히 견고하고 검증되었지만, 메모리와 사이드 채널 저항성에 대해 더 세밀한 제어를 제공하기 때문에 새 시스템에는 일반적으로 Argon2(Password Hashing Competition 우승자)가 권장됩니다.
scrypt는 실제로 메모리를 얼마나 사용하나요?
한 번의 계산당 대략 128 × N × r 바이트입니다. 일반적인 매개변수(N=16384, r=8)에서는 해시 하나당 약 16메가바이트로, 로그인 한 번에는 미미하지만 서버에서 수천 건의 동시 인증을 처리할 때는 상당한 부담이 됩니다.
scrypt는 비밀번호 해싱 외에 어디에 사용되나요?
scrypt는 일부 암호화폐(예: Litecoin)에서 proof-of-work 알고리즘으로 알려져 있습니다 — SHA-256을 사용하는 비트코인의 특징인 전용 ASIC 채굴에 대한 저항성 때문에 선택되었습니다.