[{"data":1,"prerenderedAt":482},["ShallowReactive",2],{"navigation_docs":3,"-algorithms-whirlpool":244,"-algorithms-whirlpool-surround":477},[4,52],{"title":5,"path":6,"stem":7,"children":8,"icon":51},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43,47],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Hashing","\u002Fguide\u002Fhashing","1.guide\u002F02.hashing",{"title":16,"path":17,"stem":18},"HMAC and verify","\u002Fguide\u002Fverify","1.guide\u002F03.verify",{"title":20,"path":21,"stem":22},"Salted KDFs","\u002Fguide\u002Fkdf","1.guide\u002F04.kdf",{"title":24,"path":25,"stem":26},"Length extension","\u002Fguide\u002Fextend","1.guide\u002F05.extend",{"title":28,"path":29,"stem":30},"Identify a hash","\u002Fguide\u002Fidentify","1.guide\u002F06.identify",{"title":32,"path":33,"stem":34},"Search for a transform","\u002Fguide\u002Fsearch","1.guide\u002F07.search",{"title":36,"path":37,"stem":38},"CLI","\u002Fguide\u002Fcli","1.guide\u002F08.cli",{"title":40,"path":41,"stem":42},"Agents","\u002Fguide\u002Fagents","1.guide\u002F09.agents",{"title":44,"path":45,"stem":46},"Custom algorithms","\u002Fguide\u002Fcustom","1.guide\u002F10.custom",{"title":48,"path":49,"stem":50},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F11.playground","i-lucide-book-open",{"title":53,"path":54,"stem":55,"children":56,"icon":243},"Algorithms","\u002Falgorithms","2.algorithms\u002F00.index",[57,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239],{"title":58,"path":54,"stem":55},"Every algorithm",{"title":60,"path":61,"stem":62},"SHA-256","\u002Falgorithms\u002Fsha256","2.algorithms\u002F01.sha256",{"title":64,"path":65,"stem":66},"SHA-384","\u002Falgorithms\u002Fsha384","2.algorithms\u002F02.sha384",{"title":68,"path":69,"stem":70},"SHA-512","\u002Falgorithms\u002Fsha512","2.algorithms\u002F03.sha512",{"title":72,"path":73,"stem":74},"SHA-224","\u002Falgorithms\u002Fsha224","2.algorithms\u002F04.sha224",{"title":76,"path":77,"stem":78},"SHA-512\u002F224","\u002Falgorithms\u002Fsha512-224","2.algorithms\u002F05.sha512-224",{"title":80,"path":81,"stem":82},"SHA-512\u002F256","\u002Falgorithms\u002Fsha512-256","2.algorithms\u002F06.sha512-256",{"title":84,"path":85,"stem":86},"SHA-512Half","\u002Falgorithms\u002Fsha512-half","2.algorithms\u002F07.sha512-half",{"title":88,"path":89,"stem":90},"SHA3-256","\u002Falgorithms\u002Fsha3-256","2.algorithms\u002F08.sha3-256",{"title":92,"path":93,"stem":94},"SHA3-512","\u002Falgorithms\u002Fsha3-512","2.algorithms\u002F09.sha3-512",{"title":96,"path":97,"stem":98},"Keccak-256","\u002Falgorithms\u002Fkeccak256","2.algorithms\u002F10.keccak256",{"title":100,"path":101,"stem":102},"BLAKE2b","\u002Falgorithms\u002Fblake2b","2.algorithms\u002F11.blake2b",{"title":104,"path":105,"stem":106},"BLAKE2b-256","\u002Falgorithms\u002Fblake2b-256","2.algorithms\u002F12.blake2b-256",{"title":108,"path":109,"stem":110},"BLAKE2b-224","\u002Falgorithms\u002Fblake2b-224","2.algorithms\u002F13.blake2b-224",{"title":112,"path":113,"stem":114},"BLAKE2s","\u002Falgorithms\u002Fblake2s","2.algorithms\u002F14.blake2s",{"title":116,"path":117,"stem":118},"BLAKE3","\u002Falgorithms\u002Fblake3","2.algorithms\u002F15.blake3",{"title":120,"path":121,"stem":122},"BLAKE-256","\u002Falgorithms\u002Fblake256","2.algorithms\u002F16.blake256",{"title":124,"path":125,"stem":126},"RIPEMD-160","\u002Falgorithms\u002Fripemd160","2.algorithms\u002F17.ripemd160",{"title":128,"path":129,"stem":130},"RIPEMD-320","\u002Falgorithms\u002Fripemd320","2.algorithms\u002F18.ripemd320",{"title":132,"path":133,"stem":134},"HASH160","\u002Falgorithms\u002Fhash160","2.algorithms\u002F19.hash160",{"title":136,"path":137,"stem":138},"HASH256","\u002Falgorithms\u002Fhash256","2.algorithms\u002F20.hash256",{"title":140,"path":141,"stem":142},"Whirlpool","\u002Falgorithms\u002Fwhirlpool","2.algorithms\u002F21.whirlpool",{"title":144,"path":145,"stem":146},"MD5","\u002Falgorithms\u002Fmd5","2.algorithms\u002F22.md5",{"title":148,"path":149,"stem":150},"MD4","\u002Falgorithms\u002Fmd4","2.algorithms\u002F23.md4",{"title":152,"path":153,"stem":154},"MD2","\u002Falgorithms\u002Fmd2","2.algorithms\u002F24.md2",{"title":156,"path":157,"stem":158},"NTLM","\u002Falgorithms\u002Fntlm","2.algorithms\u002F25.ntlm",{"title":160,"path":161,"stem":162},"SHA-1","\u002Falgorithms\u002Fsha1","2.algorithms\u002F26.sha1",{"title":164,"path":165,"stem":166},"SHA-0","\u002Falgorithms\u002Fsha0","2.algorithms\u002F27.sha0",{"title":168,"path":169,"stem":170},"RIPEMD-128","\u002Falgorithms\u002Fripemd128","2.algorithms\u002F28.ripemd128",{"title":172,"path":173,"stem":174},"RIPEMD-256","\u002Falgorithms\u002Fripemd256","2.algorithms\u002F29.ripemd256",{"title":176,"path":177,"stem":178},"HAVAL","\u002Falgorithms\u002Fhaval","2.algorithms\u002F30.haval",{"title":180,"path":181,"stem":182},"Tiger","\u002Falgorithms\u002Ftiger","2.algorithms\u002F31.tiger",{"title":184,"path":185,"stem":186},"CRC-32","\u002Falgorithms\u002Fcrc32","2.algorithms\u002F32.crc32",{"title":188,"path":189,"stem":190},"CRC-64","\u002Falgorithms\u002Fcrc64","2.algorithms\u002F33.crc64",{"title":192,"path":193,"stem":194},"CRC-24","\u002Falgorithms\u002Fcrc24","2.algorithms\u002F34.crc24",{"title":196,"path":197,"stem":198},"CRC-16\u002FXMODEM","\u002Falgorithms\u002Fcrc16-xmodem","2.algorithms\u002F35.crc16-xmodem",{"title":200,"path":201,"stem":202},"Adler-32","\u002Falgorithms\u002Fadler32","2.algorithms\u002F36.adler32",{"title":204,"path":205,"stem":206},"xxHash","\u002Falgorithms\u002Fxxhash","2.algorithms\u002F37.xxhash",{"title":208,"path":209,"stem":210},"FNV-1a (64-bit)","\u002Falgorithms\u002Ffnv1a","2.algorithms\u002F38.fnv1a",{"title":212,"path":213,"stem":214},"scrypt","\u002Falgorithms\u002Fscrypt","2.algorithms\u002F39.scrypt",{"title":216,"path":217,"stem":218},"PBKDF2","\u002Falgorithms\u002Fpbkdf2","2.algorithms\u002F40.pbkdf2",{"title":220,"path":221,"stem":222},"HKDF","\u002Falgorithms\u002Fhkdf","2.algorithms\u002F41.hkdf",{"title":224,"path":225,"stem":226},"EVP_BytesToKey","\u002Falgorithms\u002Fevp-bytestokey","2.algorithms\u002F42.evp-bytestokey",{"title":228,"path":229,"stem":230},"Argon2id","\u002Falgorithms\u002Fargon2id","2.algorithms\u002F43.argon2id",{"title":232,"path":233,"stem":234},"Argon2i","\u002Falgorithms\u002Fargon2i","2.algorithms\u002F44.argon2i",{"title":236,"path":237,"stem":238},"Argon2d","\u002Falgorithms\u002Fargon2d","2.algorithms\u002F45.argon2d",{"title":240,"path":241,"stem":242},"bcrypt","\u002Falgorithms\u002Fbcrypt","2.algorithms\u002F46.bcrypt","i-lucide-library",{"id":245,"title":140,"body":246,"description":470,"extension":471,"links":472,"meta":473,"navigation":474,"path":141,"seo":475,"stem":142,"__hash__":476},"docs\u002F2.algorithms\u002F21.whirlpool.md",{"type":247,"value":248,"toc":466},"minimark",[249,253,257,331,334,339,342,404,407,422,426,441,459,462],[250,251],"algorithm-facts",{"name":252},"whirlpool",[254,255,256],"p",{},"What do you get when an AES designer builds a hash? Whirlpool. Vincent Rijmen and Paulo Barreto published it in 2000 and named it after a galaxy, M51. Inside sits W, a cipher that looks a lot like AES pumped up to 512 bits. An 8x8 grid of bytes, ten rounds, S-box, shift, mix, add key. Each block keys W with the state, and the result goes back in with the block and the old state. That's the Miyaguchi-Preneel mode.",[258,259,264],"pre",{"className":260,"code":261,"language":262,"meta":263,"style":263},"language-ts shiki shiki-themes hashes hashes hashes","create(\"whirlpool\").hash(\"abc\").digest;\n\u002F\u002F \"4e2448a4c6f486bb16b6562c73b4020bf3043e3a731bce721ae1b303d97e6d4c7181eebdb6c57e277d0e34957114cbd6c797fc9d95d8b582d225292076d4eef5\"\ncreate(\"whirlpool\").hash(\"\").digest;\n\u002F\u002F \"19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3\"\n","ts","",[265,266,267,298,305,325],"code",{"__ignoreMap":263},[268,269,272,276,280,284,287,290,292,295],"span",{"class":270,"line":271},"line",1,[268,273,275],{"class":274},"sK71F","create",[268,277,279],{"class":278},"s38Sx","(",[268,281,283],{"class":282},"shU9J","\"whirlpool\"",[268,285,286],{"class":278},").",[268,288,289],{"class":274},"hash",[268,291,279],{"class":278},[268,293,294],{"class":282},"\"abc\"",[268,296,297],{"class":278},").digest;\n",[268,299,301],{"class":270,"line":300},2,[268,302,304],{"class":303},"scIB-","\u002F\u002F \"4e2448a4c6f486bb16b6562c73b4020bf3043e3a731bce721ae1b303d97e6d4c7181eebdb6c57e277d0e34957114cbd6c797fc9d95d8b582d225292076d4eef5\"\n",[268,306,308,310,312,314,316,318,320,323],{"class":270,"line":307},3,[268,309,275],{"class":274},[268,311,279],{"class":278},[268,313,283],{"class":282},[268,315,286],{"class":278},[268,317,289],{"class":274},[268,319,279],{"class":278},[268,321,322],{"class":282},"\"\"",[268,324,297],{"class":278},[268,326,328],{"class":270,"line":327},4,[268,329,330],{"class":303},"\u002F\u002F \"19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3\"\n",[254,332,333],{},"Its S-box is small Lego. Three 4-bit boxes, E, its inverse and R, snap together into the 8-bit one. So this package ships 32 nibbles, not 256 bytes. The first block Whirlpool hashes builds the S-box, the eight lookup tables and the round constants. The constants are just rows of the S-box. Nothing up its sleeve.",[335,336,338],"h2",{"id":337},"which-whirlpool-is-this","Which Whirlpool is this?",[254,340,341],{},"The final one. Whirlpool changed twice after 2000, and every revision prints 64 bytes:",[343,344,345,361],"table",{},[346,347,348],"thead",{},[349,350,351,355,358],"tr",{},[352,353,354],"th",{},"Name",[352,356,357],{},"What changed",[352,359,360],{},"The quick brown fox starts with",[362,363,364,378,391],"tbody",{},[349,365,366,370,373],{},[367,368,369],"td",{},"Whirlpool-0 (2000)",[367,371,372],{},"the original, with a random S-box",[367,374,375],{},[265,376,377],{},"4f8f5cb5",[349,379,380,383,386],{},[367,381,382],{},"Whirlpool-T (2001)",[367,384,385],{},"the S-box built from 4-bit boxes",[367,387,388],{},[265,389,390],{},"3ccf8252",[349,392,393,396,399],{},[367,394,395],{},"Whirlpool (2003, this one)",[367,397,398],{},"the mix matrix, now cir(1, 1, 4, 1, 8, 5, 2, 9)",[367,400,401],{},[265,402,403],{},"b97de512",[254,405,406],{},"The sentence is \"The quick brown fox jumps over the lazy dog\". Three answers, and only the last is the one ISO\u002FIEC 10118-3 calls Whirlpool. The 2003 fix was a single row of numbers. Put cir(1, 1, 3, 1, 5, 8, 9, 5) back and you're holding Whirlpool-T again. One row, a whole new hash.",[254,408,409,410,413,414,417,418,421],{},"So ",[265,411,412],{},"create(\"whirlpool-t\")"," throws instead of guessing. ",[265,415,416],{},"identifyDigest"," computes Whirlpool for a 64-byte digest and names the two older ones as hashes it can't compute. A digest that matches nothing here might be one of them. PHP's ",[265,419,420],{},"hash(\"whirlpool\")"," and RHash give the final one too.",[335,423,425],{"id":424},"is-it-broken","Is it broken?",[254,427,428,429,432,433,436,437,440],{},"No. Collisions on the hash reach 5.5 of its 10 rounds, and 8 on the compression function alone. A distinguisher covers all ten rounds of that compression function. Even the people attacking it call its impact on the hash limited. It sits in ISO\u002FIEC 10118-3, and NESSIE picked it. VeraCrypt still offers it for deriving volume header keys. So ",[265,430,431],{},"pbkdf2"," and ",[265,434,435],{},"hkdf"," take it as their ",[265,438,439],{},"digest",". VeraCrypt's own PBKDF2 test vector matches byte for byte.",[254,442,443,444,447,448,454,455,458],{},"Its digest is the whole state, though. So ",[265,445,446],{},"Whirlpool(secret + message)"," extends like SHA-256. Same 0x80, only the length field takes 32 bytes, not 8. ",[449,450,451],"a",{"href":25},[265,452,453],{},"extendDigest"," forges it without the secret. Want a MAC? HMAC runs over its 64-byte blocks and matches PHP's ",[265,456,457],{},"hash_hmac",".",[254,460,461],{},"It isn't fast. Expect a bit under half of SHA-512's speed here. Every 64 bytes cost ten AES-style rounds, twice. Got old Whirlpool digests to check? This is your hash. Starting fresh? SHA-512 or BLAKE2b.",[463,464,465],"style",{},"html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .scIB-, html code.shiki .scIB-{--shiki-light:var(--shiki-token-comment);--shiki-default:var(--shiki-token-comment);--shiki-dark:var(--shiki-token-comment)}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":263,"searchDepth":300,"depth":300,"links":467},[468,469],{"id":337,"depth":300,"text":338},{"id":424,"depth":300,"text":425},"Rijmen and Barreto's 512-bit hash from 2000. The final 2003 revision that ISO\u002FIEC 10118-3 and VeraCrypt use","md",null,{},true,{"title":140,"description":470},"eiNemIdXFZ6X0_-1n7uZ8LPYo--9zpv8_Q6gIGncJEU",[478,480],{"title":136,"path":137,"stem":138,"description":479,"children":-1},"SHA-256 twice. Bitcoin transaction ids and block hashes and the Base58Check checksum",{"title":144,"path":145,"stem":146,"description":481,"children":-1},"A 128-bit hash broken for collisions since 2004. Still on download pages and in checksum files and it has HMAC",1791911607840]