---
title: Scrypt
slug: scrypt
qid: 
snapshot: enwiki-001332071125
content_hash: 
license: CC BY-SA 4.0
source: https://en.wikipedia.org/w/index.php?oldid=1332071125
tags: [22906087, 23118434, 23302980, 23603337, 26025354, 28519836, 29689885]
---

# Scrypt

> [!note] Provenance
> Snapshot `enwiki-001332071125` · content root `…`
> Derived from <https://en.wikipedia.org/w/index.php?oldid=1332071125> · Licensed CC BY-SA 4.0

In cryptography, scrypt (pronounced "ess crypt" ) is a password-based key derivation function created by Colin Percival in March 2009, originally for the Tarsnap online backup service. The algorithm was specifically designed to make it costly to perform large-scale custom hardware attacks by requiring large amounts of memory. In 2016, the scrypt algorithm was published by IETF as RFC 7914. A simplified version of scrypt is used as a proof-of-work scheme by a number of cryptocurrencies, first implemented by an anonymous programmer called ArtForz in Tenebrix and followed by Fairbrix and Litecoin soon after.

In cryptography, scrypt (pronounced "ess crypt" ) is a password-based key derivation function created by Colin Percival in March 2009, originally for the Tarsnap online backup service. The algorithm was specifically designed to make it costly to perform large-scale custom hardware attacks by requiring large amounts of memory. In 2016, the scrypt algorithm was published by IETF as RFC 7914. A simplified version of scrypt is used as a proof-of-work scheme by a number of cryptocurrencies, first implemented by an anonymous programmer called ArtForz in Tenebrix and followed by Fairbrix and Litecoin soon after. This notation is used by RFC 7914 for specifying a usage of PBKDF2 with c = 1. Function ROMix(Block, Iterations) Create Iterations copies of X X ← Block for i ← 0 to Iterations−1 do V i ← X X ← BlockMix(X) for i ← 0 to Iterations−1 do j ← Integerify(X) mod Iterations X ← BlockMix(X xor V j ) return X Where RFC 7914 defines as the result of interpreting the last 64 bytes of X as a little-endian integer A 1 . Since Iterations equals 2 to the power of N, only the first bytes among the last 64 bytes of X, interpreted as a little-endian integer A 2 , are actually needed to compute Integerify(X) mod Iterations = A 1 mod Iterations = A 2 mod Iterations . Function BlockMix(B): The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) r ← Length(B) / 128; Treat B as an array of 2r 64-byte chunks [B 0 ...B 2r-1 ] ← B X ← B 2r−1 for i ← 0 to 2r−1 do X ← Salsa20/8(X xor B i ) // Salsa20/8 hashes from 64-bytes to 64-bytes Y i ← X return ← Y 0 ∥Y 2 ∥...∥Y 2r−2 ∥ Y 1 ∥Y 3 ∥...∥Y 2r−1 Where Salsa20/8 is the 8-round version of Salsa20. ==See also== Argon2 – winner of the Password Hashing Competition in 2015 bcrypt – blowfish-based password-hashing function bcrypt – blowfish-based cross-platform file encryption utility developed in 2002 crypt – Unix C library function crypt – Unix utility ccrypt – utility Key derivation function Key stretching mcrypt – utility PBKDF2 – a widely used standard Password-Based Key Derivation Function 2 PufferFish – a cache-hard password hashing function based on improved bcrypt design Space–time tradeoff yescrypt – successor to scrypt
