[{"data":1,"prerenderedAt":512},["ShallowReactive",2],{"navigation_docs":3,"-algorithms-haval":244,"-algorithms-haval-surround":507},[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":176,"body":246,"description":500,"extension":501,"links":502,"meta":503,"navigation":504,"path":177,"seo":505,"stem":178,"__hash__":506},"docs\u002F2.algorithms\u002F30.haval.md",{"type":247,"value":248,"toc":496},"minimark",[249,253,257,268,361,364,379,382,387,433,436,458,462,485,492],[250,251],"algorithm-facts",{"name":252},"haval",[254,255,256],"p",{},"HAVAL isn't one hash. It's fifteen. Zheng, Pieprzyk and Seberry brought it to AUSCRYPT '92 with two dials. One sets 3, 4 or 5 passes over each 128-byte block. The other picks 128, 160, 192, 224 or 256 bits. The name alone tells you neither.",[254,258,259,260,263,264,267],{},"So which one is plain ",[261,262,252],"code",{},"? The one the authors' ",[261,265,266],{},"haval.h"," builds when nobody touches it: 3 passes, 128 bits. Anything else you ask for out loud.",[269,270,275],"pre",{"className":271,"code":272,"language":273,"meta":274,"style":274},"language-ts shiki shiki-themes hashes hashes hashes","create(\"haval\").hash(\"abc\").digest; \u002F\u002F \"9e40ed883fb63e985d299b40cda2b8f2\"\ncreate(\"haval\").hash(\"abc\").options; \u002F\u002F { encoding: \"hex\", passes: 3, bits: 128 }\ncreate(\"haval\").hash(\"abc\", { passes: 5, bits: 256 }).digest;\n\u002F\u002F \"976cd6254c337969e5913b158392a2921af16fca51f5601d486e0a9de01156e7\"\n","ts","",[261,276,277,312,335,355],{"__ignoreMap":274},[278,279,282,286,290,294,297,300,302,305,308],"span",{"class":280,"line":281},"line",1,[278,283,285],{"class":284},"sK71F","create",[278,287,289],{"class":288},"s38Sx","(",[278,291,293],{"class":292},"shU9J","\"haval\"",[278,295,296],{"class":288},").",[278,298,299],{"class":284},"hash",[278,301,289],{"class":288},[278,303,304],{"class":292},"\"abc\"",[278,306,307],{"class":288},").digest; ",[278,309,311],{"class":310},"scIB-","\u002F\u002F \"9e40ed883fb63e985d299b40cda2b8f2\"\n",[278,313,315,317,319,321,323,325,327,329,332],{"class":280,"line":314},2,[278,316,285],{"class":284},[278,318,289],{"class":288},[278,320,293],{"class":292},[278,322,296],{"class":288},[278,324,299],{"class":284},[278,326,289],{"class":288},[278,328,304],{"class":292},[278,330,331],{"class":288},").options; ",[278,333,334],{"class":310},"\u002F\u002F { encoding: \"hex\", passes: 3, bits: 128 }\n",[278,336,338,340,342,344,346,348,350,352],{"class":280,"line":337},3,[278,339,285],{"class":284},[278,341,289],{"class":288},[278,343,293],{"class":292},[278,345,296],{"class":288},[278,347,299],{"class":284},[278,349,289],{"class":288},[278,351,304],{"class":292},[278,353,354],{"class":288},", { passes: 5, bits: 256 }).digest;\n",[278,356,358],{"class":280,"line":357},4,[278,359,360],{"class":310},"\u002F\u002F \"976cd6254c337969e5913b158392a2921af16fca51f5601d486e0a9de01156e7\"\n",[254,362,363],{},"Every result names its passes and bits, defaults too. A HAVAL digest without them is a guess. And a wrong guess still looks like a perfectly good hash.",[254,365,366,367,370,371,374,375,378],{},"Don't cut HAVAL-256 down to get HAVAL-128 either. The last block carries the pass count and the length. The spare words get folded into the kept ones, not dropped. HAVAL-256 of ",[261,368,369],{},"abc"," starts with ",[261,372,373],{},"8699f1e3",", HAVAL-128 is ",[261,376,377],{},"9e40ed88",". Nothing in common.",[254,380,381],{},"Where do the constants come from? π. The eight starting words and the 128 step constants are its hex digits after the point, the same ones Blowfish opens with. This package works them out the first time you ask, like it does for bcrypt.",[383,384,386],"h2",{"id":385},"how-broken-is-it","How broken is it?",[388,389,390,405],"table",{},[391,392,393],"thead",{},[394,395,396,402],"tr",{},[397,398,399],"th",{},[261,400,401],{},"passes",[397,403,404],{},"Best collision attack",[406,407,408,417,425],"tbody",{},[394,409,410,414],{},[411,412,413],"td",{},"3 (default)",[411,415,416],{},"Practical. 2^29 compressions (Van Rompay and others, 2003), and HAVAL-128 in about 2^6 hashes (Wang and others, 2004)",[394,418,419,422],{},[411,420,421],{},"4",[411,423,424],{},"Practical. 2^36 (Yu, Wang, Yun and Park, 2006)",[394,426,427,430],{},[411,428,429],{},"5",[411,431,432],{},"2^123 for HAVAL-256 (same paper), the first attack under its birthday bound",[254,434,435],{},"More passes buy time, not safety.",[254,437,438,439,442,443,449,450,453,454,457],{},"And HAVAL-256 has the MD5 problem on top. Its digest is the whole state, so ",[261,440,441],{},"HAVAL-256(secret + message)"," extends in every pass count. ",[444,445,446],"a",{"href":25},[261,447,448],{},"extendDigest"," forges it once its ",[261,451,452],{},"parameters"," name the passes and ",[261,455,456],{},"bits: 256",". The shorter ones fold the state and dodge that. Only that, though.",[383,459,461],{"id":460},"why-keep-it","Why keep it?",[254,463,464,465,468,469,472,473,476,477,480,481,484],{},"PHP's ",[261,466,467],{},"hash()"," still lists all fifteen, ",[261,470,471],{},"haval128,3"," through ",[261,474,475],{},"haval256,5",". Tripwire still ships the authors' C code. HMAC runs over the 128-byte blocks and matches PHP's ",[261,478,479],{},"hash_hmac"," in every variant. ",[261,482,483],{},"identifyDigest"," lists HAVAL three times at each of its lengths, once per pass count, since a 16-byte digest could be any of them.",[254,486,487,488,491],{},"Got an old ",[261,489,490],{},"haval160,4"," column somewhere? That's what this page is for. Anything new gets SHA-256.",[493,494,495],"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":274,"searchDepth":314,"depth":314,"links":497},[498,499],{"id":385,"depth":314,"text":386},{"id":460,"depth":314,"text":461},"Fifteen hashes under one name from 1992. Three pass counts times five lengths and the name alone never says which","md",null,{},true,{"title":176,"description":500},"GpG-qN76Ow58LYBVIr_w38KDItvCTSuzlg_QVGsuDTI",[508,510],{"title":172,"path":173,"stem":174,"description":509,"children":-1},"RIPEMD-128 with both lines kept apart for 32 bytes. Exactly as strong as RIPEMD-128 by design and it has HMAC",{"title":180,"path":181,"stem":182,"description":511,"children":-1},"Anderson and Biham's 1996 hash for 64-bit machines. 192 bits and the hash under every Tiger Tree Hash",1791911608177]