[{"data":1,"prerenderedAt":217},["ShallowReactive",2],{"term-s\u002Fsalt":3,"related-s\u002Fsalt":206},{"id":4,"title":5,"acronym":6,"body":7,"category":188,"description":189,"difficulty":190,"extension":191,"letter":192,"meta":193,"navigation":194,"path":195,"related":196,"seo":200,"sitemap":201,"stem":204,"subcategory":6,"__hash__":205},"terms\u002Fterms\u002Fs\u002Fsalt.md","Salt",null,{"type":8,"value":9,"toc":182},"minimark",[10,15,19,23,26,30,171,175,178],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"A salt is random gibberish you add to a password before hashing it so two people with the same password get completely different hashes. Without salt, hackers could pre-compute a giant table of common password hashes and look yours up instantly. Salt ruins that plan.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"A cryptographic salt is a random value added to a password before hashing. It ensures that identical passwords produce different hashes, preventing rainbow table attacks. Salts are stored alongside the hash in the database.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Salt is built into bcrypt automatically\nimport bcrypt from 'bcrypt';\nconst saltRounds = 10; \u002F\u002F cost factor\nconst salt = await bcrypt.genSalt(saltRounds);\nconst hash = await bcrypt.hash('password123', salt);\n\u002F\u002F The salt is embedded in the resulting hash string\n","javascript","",[38,39,40,49,77,100,128,165],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F Salt is built into bcrypt automatically\n",[41,50,52,56,60,63,67,71,74],{"class":43,"line":51},2,[41,53,55],{"class":54},"s7zQu","import",[41,57,59],{"class":58},"sTEyZ"," bcrypt ",[41,61,62],{"class":54},"from",[41,64,66],{"class":65},"sMK4o"," '",[41,68,70],{"class":69},"sfazB","bcrypt",[41,72,73],{"class":65},"'",[41,75,76],{"class":65},";\n",[41,78,80,84,87,90,94,97],{"class":43,"line":79},3,[41,81,83],{"class":82},"spNyl","const",[41,85,86],{"class":58}," saltRounds ",[41,88,89],{"class":65},"=",[41,91,93],{"class":92},"sbssI"," 10",[41,95,96],{"class":65},";",[41,98,99],{"class":47}," \u002F\u002F cost factor\n",[41,101,103,105,108,110,113,116,119,123,126],{"class":43,"line":102},4,[41,104,83],{"class":82},[41,106,107],{"class":58}," salt ",[41,109,89],{"class":65},[41,111,112],{"class":54}," await",[41,114,115],{"class":58}," bcrypt",[41,117,118],{"class":65},".",[41,120,122],{"class":121},"s2Zo4","genSalt",[41,124,125],{"class":58},"(saltRounds)",[41,127,76],{"class":65},[41,129,131,133,136,138,140,142,144,147,150,152,155,157,160,163],{"class":43,"line":130},5,[41,132,83],{"class":82},[41,134,135],{"class":58}," hash ",[41,137,89],{"class":65},[41,139,112],{"class":54},[41,141,115],{"class":58},[41,143,118],{"class":65},[41,145,146],{"class":121},"hash",[41,148,149],{"class":58},"(",[41,151,73],{"class":65},[41,153,154],{"class":69},"password123",[41,156,73],{"class":65},[41,158,159],{"class":65},",",[41,161,162],{"class":58}," salt)",[41,164,76],{"class":65},[41,166,168],{"class":43,"line":167},6,[41,169,170],{"class":47},"\u002F\u002F The salt is embedded in the resulting hash string\n",[11,172,174],{"id":173},"when-youll-hear-this","When You'll Hear This",[16,176,177],{},"\"Make sure you're salting passwords before hashing.\" \u002F \"bcrypt handles salt automatically, don't roll your own.\"",[179,180,181],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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":36,"searchDepth":51,"depth":51,"links":183},[184,185,186,187],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":173,"depth":51,"text":174},"security","A salt is random gibberish you add to a password before hashing it so two people with the same password get completely different hashes.","intermediate","md","s",{},true,"\u002Fterms\u002Fs\u002Fsalt",[197,198,199],"Hashing","Bcrypt","Password Manager",{"title":5,"description":189},{"changefreq":202,"priority":203},"weekly",0.7,"terms\u002Fs\u002Fsalt","5rNHIkGQOSC894g81_JVZ9QRGZ2EjY7B4h7hjLJl2Sw",[207,210,214],{"title":198,"path":208,"acronym":6,"category":188,"difficulty":190,"description":209},"\u002Fterms\u002Fb\u002Fbcrypt","Bcrypt is the gold-standard password hasher that's intentionally slow.",{"title":197,"path":211,"acronym":6,"category":188,"difficulty":212,"description":213},"\u002Fterms\u002Fh\u002Fhashing","beginner","Hashing is a one-way blender for data. You throw a password in, it spits out a weird string of letters and numbers, and there's no way to reverse it.",{"title":199,"path":215,"acronym":6,"category":188,"difficulty":212,"description":216},"\u002Fterms\u002Fp\u002Fpassword-manager","A password manager remembers all your passwords so you don't have to reuse the same one everywhere.",1776518310740]