[{"data":1,"prerenderedAt":258},["ShallowReactive",2],{"term-e\u002Fencoding":3,"related-e\u002Fencoding":244},{"id":4,"title":5,"acronym":6,"body":7,"category":226,"description":227,"difficulty":228,"extension":229,"letter":230,"meta":231,"navigation":101,"path":232,"related":233,"seo":238,"sitemap":239,"stem":242,"subcategory":6,"__hash__":243},"terms\u002Fterms\u002Fe\u002Fencoding.md","Encoding",null,{"type":8,"value":9,"toc":220},"minimark",[10,15,24,28,31,35,209,213,216],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18,19,23],"p",{},"Encoding is converting data into a different format for safe transport or storage — not for security, but to prevent misinterpretation. URL encoding turns spaces into ",[20,21,22],"code",{},"%20"," so URLs stay valid. Base64 encoding turns binary data into text. It's not encryption — encoded data can be decoded by anyone.",[11,25,27],{"id":26},"real-talk","Real Talk",[16,29,30],{},"Encoding transforms data into a different representation for compatibility or safe transmission. In security, output encoding is critical for injection prevention — encoding data for the specific context (HTML, URL, JSON) it will be inserted into. Different from encryption: encoding has no key and is reversible by anyone.",[11,32,34],{"id":33},"show-me-the-code","Show Me The Code",[36,37,42],"pre",{"className":38,"code":39,"language":40,"meta":41,"style":41},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F URL encoding\nconst encoded = encodeURIComponent('hello world & more');\n\u002F\u002F 'hello%20world%20%26%20more'\n\n\u002F\u002F Base64 encoding (NOT encryption)\nconst b64 = Buffer.from('secret data').toString('base64');\n\u002F\u002F 'c2VjcmV0IGRhdGE='\nconst decoded = Buffer.from(b64, 'base64').toString();\n\u002F\u002F 'secret data'\n","javascript","",[20,43,44,53,90,96,103,109,157,163,203],{"__ignoreMap":41},[45,46,49],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"sHwdD","\u002F\u002F URL encoding\n",[45,54,56,60,64,68,72,75,78,82,84,87],{"class":47,"line":55},2,[45,57,59],{"class":58},"spNyl","const",[45,61,63],{"class":62},"sTEyZ"," encoded ",[45,65,67],{"class":66},"sMK4o","=",[45,69,71],{"class":70},"s2Zo4"," encodeURIComponent",[45,73,74],{"class":62},"(",[45,76,77],{"class":66},"'",[45,79,81],{"class":80},"sfazB","hello world & more",[45,83,77],{"class":66},[45,85,86],{"class":62},")",[45,88,89],{"class":66},";\n",[45,91,93],{"class":47,"line":92},3,[45,94,95],{"class":51},"\u002F\u002F 'hello%20world%20%26%20more'\n",[45,97,99],{"class":47,"line":98},4,[45,100,102],{"emptyLinePlaceholder":101},true,"\n",[45,104,106],{"class":47,"line":105},5,[45,107,108],{"class":51},"\u002F\u002F Base64 encoding (NOT encryption)\n",[45,110,112,114,117,119,122,125,128,130,132,135,137,139,141,144,146,148,151,153,155],{"class":47,"line":111},6,[45,113,59],{"class":58},[45,115,116],{"class":62}," b64 ",[45,118,67],{"class":66},[45,120,121],{"class":62}," Buffer",[45,123,124],{"class":66},".",[45,126,127],{"class":70},"from",[45,129,74],{"class":62},[45,131,77],{"class":66},[45,133,134],{"class":80},"secret data",[45,136,77],{"class":66},[45,138,86],{"class":62},[45,140,124],{"class":66},[45,142,143],{"class":70},"toString",[45,145,74],{"class":62},[45,147,77],{"class":66},[45,149,150],{"class":80},"base64",[45,152,77],{"class":66},[45,154,86],{"class":62},[45,156,89],{"class":66},[45,158,160],{"class":47,"line":159},7,[45,161,162],{"class":51},"\u002F\u002F 'c2VjcmV0IGRhdGE='\n",[45,164,166,168,171,173,175,177,179,182,185,188,190,192,194,196,198,201],{"class":47,"line":165},8,[45,167,59],{"class":58},[45,169,170],{"class":62}," decoded ",[45,172,67],{"class":66},[45,174,121],{"class":62},[45,176,124],{"class":66},[45,178,127],{"class":70},[45,180,181],{"class":62},"(b64",[45,183,184],{"class":66},",",[45,186,187],{"class":66}," '",[45,189,150],{"class":80},[45,191,77],{"class":66},[45,193,86],{"class":62},[45,195,124],{"class":66},[45,197,143],{"class":70},[45,199,200],{"class":62},"()",[45,202,89],{"class":66},[45,204,206],{"class":47,"line":205},9,[45,207,208],{"class":51},"\u002F\u002F 'secret data'\n",[11,210,212],{"id":211},"when-youll-hear-this","When You'll Hear This",[16,214,215],{},"\"URL-encode the query parameters before appending them.\" \u002F \"Base64 is encoding, not encryption — don't use it to hide data.\"",[217,218,219],"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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":41,"searchDepth":55,"depth":55,"links":221},[222,223,224,225],{"id":13,"depth":55,"text":14},{"id":26,"depth":55,"text":27},{"id":33,"depth":55,"text":34},{"id":211,"depth":55,"text":212},"security","Encoding is converting data into a different format for safe transport or storage — not for security, but to prevent misinterpretation.","beginner","md","e",{},"\u002Fterms\u002Fe\u002Fencoding",[234,235,236,237],"Escape","Sanitization","Encryption","XSS",{"title":5,"description":227},{"changefreq":240,"priority":241},"weekly",0.7,"terms\u002Fe\u002Fencoding","f5ntnlM_TzJFU_aaQPE3LfAWZO0YU6qXQ2zc9CjD3E8",[245,248,251,254],{"title":236,"path":246,"acronym":6,"category":226,"difficulty":228,"description":247},"\u002Fterms\u002Fe\u002Fencryption","Encryption is scrambling your message into gibberish so only someone with the secret decoder ring can read it.",{"title":234,"path":249,"acronym":6,"category":226,"difficulty":228,"description":250},"\u002Fterms\u002Fe\u002Fescape","Escaping means converting special characters into their safe equivalents before putting them in HTML, SQL, or a shell command.",{"title":235,"path":252,"acronym":6,"category":226,"difficulty":228,"description":253},"\u002Fterms\u002Fs\u002Fsanitization","Sanitization is cleaning up user input before using it — stripping out anything dangerous like script tags or SQL commands.",{"title":237,"path":255,"acronym":237,"category":226,"difficulty":256,"description":257},"\u002Fterms\u002Fx\u002Fxss","intermediate","XSS stands for Cross-Site Scripting. Hackers inject their own JavaScript into your site so when other users visit, the evil script runs in their browser.",1776518276963]