[{"data":1,"prerenderedAt":981},["ShallowReactive",2],{"$B3SvcJdz-H":3,"pages-links":23,"posts-links":29,"posts-search":58,"blog-padding-oracle-attacks-rubiks-cow":129,"decks-for-padding-oracle-attacks-rubiks-cow":976,"meta":977},{"id":4,"title":5,"author":6,"description":14,"extension":15,"meta":16,"repository":17,"stem":21,"__hash__":22},"meta\u002Fmeta.yml","bmo.dev",{"name":7,"github":8,"gitlab":9,"email":10,"linkedin":11,"mastodon":12,"bio":13},"William Little","https:\u002F\u002Fgithub.com\u002Fbmodotdev\u002F","https:\u002F\u002Fgitlab.com\u002Fbmodotdev\u002F","L29hqTSwqROvoJ8hMTI2","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fwilliam-e-little-jr\u002F","https:\u002F\u002Fdefcon.social\u002F@bmodotdev","I am a Full Stack Software & DevOps Engineer who loves building and experimenting with Software, Linux, & electronics.\n","A personal blog where I share my thoughts, projects, and anything I might find interesting or helpful.\n","yml",{},{"url":18,"git":19,"branch":20},"https:\u002F\u002Fgitlab.com\u002Fbmodotdev\u002Fbmo.dev\u002F","git@gitlab.com:bmodotdev\u002Fbmo.dev.git","main","meta","MPtcc2KHfBCBy4V4SDhZFIvjyZ_Ba4e-yDnx_Ok_KOs",[24],{"path":25,"extension":26,"title":27,"id":28},"\u002Fabout","md","About","pages\u002Fabout.md",[30,34,38,42,46,50,54],{"path":31,"extension":26,"title":32,"id":33},"\u002Fblog\u002Fconventional-commit-caveats","Conventional Commit Caveats","blog\u002Fblog\u002Fconventional-commit-caveats.md",{"path":35,"extension":26,"title":36,"id":37},"\u002Fblog\u002Fdodging-a-critical-cve-with-zta","Dodging a Critical CVE with ZTA","blog\u002Fblog\u002Fdodging-a-critical-cve-with-zta.md",{"path":39,"extension":26,"title":40,"id":41},"\u002Fblog\u002Flog4perl-mixed-screen-appender","Mixed Output Streams with Log4perl Screen Appender","blog\u002Fblog\u002Flog4perl-mixed-screen-appender.md",{"path":43,"extension":26,"title":44,"id":45},"\u002Fblog\u002Fmake-version","make version","blog\u002Fblog\u002Fmake-version.md",{"path":47,"extension":26,"title":48,"id":49},"\u002Fblog\u002Fpadding-oracle-attacks-rubiks-cow","Padding Oracle Attacks & Rubik’s Cow","blog\u002Fblog\u002Fpadding-oracle-attacks-rubiks-cow.md",{"path":51,"extension":26,"title":52,"id":53},"\u002Fblog\u002Ftracing-signals-in-linux","Tracing Signals in Linux","blog\u002Fblog\u002Ftracing-signals-in-linux.md",{"path":55,"extension":26,"title":56,"id":57},"\u002Fblog\u002Fwhy-are-go-modules-in-my-nodes-modules","Why are Go modules in my node_modules?","blog\u002Fblog\u002Fwhy-are-go-modules-in-my-nodes-modules.md",[59,69,81,90,100,108,117],{"path":55,"title":56,"description":60,"tags":61,"thumbnail":64,"created":68},"Let’s dissect this developer pattern that leads to arbitrary code execution across languages.",[62,63],"go","js",{"sm":65,"md":66,"lg":67},"\u002Fassets\u002Fdavid-mitchell-great-british-baking-show_sm.webp","\u002Fassets\u002Fdavid-mitchell-great-british-baking-show_md.webp","\u002Fassets\u002Fdavid-mitchell-great-british-baking-show_lg.webp","2026-04-07",{"path":35,"title":36,"description":70,"tags":71,"thumbnail":76,"created":80},"Let’s discuss tenets of Zero Trust Architecture, Go, gRPC, and why everyone dodged CVE-2026-33186, right?",[72,73,62,74,75],"awk","cve","grpc","zta",{"sm":77,"md":78,"lg":79},"\u002Fassets\u002Fdodging-the-flyer_sm.webp","\u002Fassets\u002Fdodging-the-flyer_md.webp","\u002Fassets\u002Fdodging-the-flyer_lg.webp","2026-04-02",{"path":47,"title":48,"description":82,"tags":83,"thumbnail":85,"created":89},"In this thought experiment, you’ll learn about cryptographic primitives, combinitorical group theory, and along the way, gain a deeper appreciation for 1999’s film, The Matrix. Oh yeah, and a Cow!",[84],"cryptography",{"sm":86,"md":87,"lg":88},"\u002Fassets\u002Fbournemouth_sm.webp","\u002Fassets\u002Fbournemouth_md.webp","\u002Fassets\u002Fbournemouth_lg.webp","2026-03-06",{"path":43,"title":44,"description":91,"tags":92,"thumbnail":95,"created":99},"Here is how I went about implementing a simple versioning system for my Go project using Conventional Commmits, awk, and make.",[72,93,62,94],"git","semver",{"sm":96,"md":97,"lg":98},"\u002Fassets\u002Flego-pieces_sm.webp","\u002Fassets\u002Flego-pieces_md.webp","\u002Fassets\u002Flego-pieces_lg.webp","2025-11-11",{"path":31,"title":32,"description":101,"tags":102,"thumbnail":103,"created":107},"The Conventional Commmits spec aims to bring structure to commit messages so that we write succint yet meaningful commits. That sounds great, but let’s examine some potential drawbacks.",[93,94],{"sm":104,"md":105,"lg":106},"\u002Fassets\u002Fgit-commit_sm.webp","\u002Fassets\u002Fgit-commit_md.webp","\u002Fassets\u002Fgit-commit_lg.webp","2025-11-07",{"path":39,"title":40,"description":109,"tags":110,"thumbnail":112,"created":116},"Log4perl provides a powerful logging framework, but how can we dynamically and meaninfully use stdout and stderr?",[111],"perl",{"sm":113,"md":114,"lg":115},"\u002Fassets\u002Fperl-latte-onion_100x100.webp","\u002Fassets\u002Fperl-latte-onion_250x250.webp","\u002Fassets\u002Fperl-latte-onion_600x600.webp","2022-02-14",{"path":51,"title":52,"description":118,"tags":119,"thumbnail":124,"created":128},"Signals, or software interrupts, are used to communicate with a process. They could be used to kill a process, restart, or signal a segmentation fault, but how can we know where that signal came from?",[120,121,122,123],"signals","systemtap","strace","linux",{"sm":125,"md":126,"lg":127},"\u002Fassets\u002Ftraffic-light_sm.webp","\u002Fassets\u002Ftraffic-light_md.webp","\u002Fassets\u002Ftraffic-light_lg.webp","2022-02-13",{"id":49,"title":48,"body":130,"created":89,"description":82,"extension":26,"meta":968,"navigation":969,"path":47,"seo":970,"stem":971,"tags":972,"thumbnail":973,"updated":974,"__hash__":975},{"type":131,"value":132,"toc":953},"minimark",[133,158,162,180,207,317,321,336,350,354,394,398,415,436,439,443,472,489,493,502,533,539,557,567,571,584,597,618,622,625,647,665,668,672,675,684,702,711,715,727,731,746,776,780,792,811,832,844,872,875,888,910,920,949],[134,135,136,144],"with-caption",{},[137,138,139],"p",{},[140,141],"img",{"alt":142,"src":88,"target":143},"BBC’s Look Around You","_blank",[145,146,148],"template",{"v-slot:caption":147},"",[137,149,150,151],{},"Wherever you are, whatever you do, ",[152,153,157],"a",{"href":154,"rel":155,"target":143},"https:\u002F\u002Fwww.bbc.com\u002Fcomedy\u002Flookaroundyou\u002Fwallpaper\u002F",[156],"nofollow","Look Around You",[159,160,157],"h2",{"id":161},"look-around-you",[137,163,164,165,169,170,175,176,179],{},"Seriously, just, look around you.\nIn this thought experiment, you’ll learn about cryptographic\nprimitives, combinitorical group theory, and along the way, gain a\ndeeper appreciation for 1999’s film, ",[166,167,168],"em",{},"The Matrix",".\nMy challenge here is to explain the 1998 “Padding Oracle Attack” by\nSwiss Cryptographer ",[152,171,174],{"href":172,"rel":173,"target":143},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDaniel_Bleichenbacher",[156],"Daniel Bleichenbacher","\nto the average Luddite, which for me, has ",[166,177,178],{},"truly"," become a term of\nendearment in our digital world.",[137,181,182,183,188,189,192,193,196,197,202,203,206],{},"To make this approachable, we will employ a\n",[152,184,187],{"href":185,"rel":186,"target":143},"https:\u002F\u002Fweb.archive.org\u002Fweb\u002F20130313025727\u002Fhttp:\u002F\u002Fimagine.gsfc.nasa.gov\u002Fdocs\u002Ffeatures\u002Ftopics\u002Fsnr_group\u002Fspherical_cow.html",[156],"spherical cow","\n(",[166,190,191],{},"full-time w\u002F comprehensive benefits package",").\nThat’s a \"",[166,194,195],{},"toy model","”, where we intentionally simplify the problem\nto better focus upon different aspects.\nAs we grasp core primitives of our problem, our spherical cow will\nbegin to take shape, adding legs, a tail, perhaps a tactical foregrip.\nIn this thought experiment, our spherical cow will be\n",[152,198,201],{"href":199,"rel":200,"target":143},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRubik%27s_Cube",[156],"Rubik’s Cube",";\nthe 1970’s “Magic Cube” 3D combination puzzle toy.\nColloquially, I’ll refer to this toy model as ",[166,204,205],{},"Rubik’s Cow",".",[208,209,213],"pre",{"className":210,"code":211,"language":212,"meta":147,"style":147},"language-bash shiki shiki-themes houston","$ cowsay\n ________________________________________\n\u002F \"They are already here among us - they \\\n\\ just call themselves Hungarians\"       \u002F\n ----------------------------------------\n     \\   ^__^\n      \\  (oo)\\_______\n         (__)\\       )\\\u002F\\\n             ||----w |\n             ||     ||\n","bash",[214,215,216,229,235,248,257,263,272,281,299,311],"code",{"__ignoreMap":147},[217,218,221,225],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"stHQG","$",[217,226,228],{"class":227},"se2J0"," cowsay\n",[217,230,232],{"class":219,"line":231},2,[217,233,234],{"class":223}," ________________________________________\n",[217,236,238,241,244],{"class":219,"line":237},3,[217,239,240],{"class":223},"\u002F",[217,242,243],{"class":227}," \"They are already here among us - they ",[217,245,247],{"class":246},"sLo_3","\\\n",[217,249,251,254],{"class":219,"line":250},4,[217,252,253],{"class":227},"\\ just call themselves Hungarians\"",[217,255,256],{"class":227},"       \u002F\n",[217,258,260],{"class":219,"line":259},5,[217,261,262],{"class":223}," ----------------------------------------\n",[217,264,266,269],{"class":219,"line":265},6,[217,267,268],{"class":223},"     \\",[217,270,271],{"class":227},"   ^__^\n",[217,273,275,278],{"class":219,"line":274},7,[217,276,277],{"class":223},"      \\",[217,279,280],{"class":246},"  (oo)\\_______\n",[217,282,284,287,290,293,296],{"class":219,"line":283},8,[217,285,286],{"class":246},"         (",[217,288,289],{"class":223},"__",[217,291,292],{"class":246},")",[217,294,295],{"class":223},"\\",[217,297,298],{"class":246},"       )\\\u002F\\\n",[217,300,302,305,308],{"class":219,"line":301},9,[217,303,304],{"class":246},"             ||",[217,306,307],{"class":223},"----w",[217,309,310],{"class":246}," |\n",[217,312,314],{"class":219,"line":313},10,[217,315,316],{"class":246},"             ||     ||\n",[159,318,320],{"id":319},"gather-your-supplies","Gather Your Supplies",[137,322,323,324,327,328,331,332,335],{},"For this experiment you will need the following supplies: colorblind\nglasses, a Rubik’s cube, a blind ",[166,325,326],{},"Skeptic",", an all-knowing ",[166,329,330],{},"Oracle",", and\na mathematical ",[166,333,334],{},"Architect",".\nIn the absence of colorblind glasses, a 7W laser just outside the\nultraviolet range, approximately 445nm to 470nm, will do.\nIf neither are available, simply use a blindfold.",[137,337,338,339,342,343,346,347,349],{},"As for ",[166,340,341],{},"The Skeptic"," & ",[166,344,345],{},"The Oracle",", to make this experiment accessible to\nall, you may assume any human that can speak is capable of both\narrogant skepticism and prophetic predictions.\nFor groups lacking a mathematical ",[166,348,334],{},", anyone who can echo the\nsmug manifestation of machine will be perfectly adequate in lieu of\nmathematical prowess.",[159,351,353],{"id":352},"experiment-one","Experiment One",[355,356,357,361,368,375,381,389],"ol",{},[358,359,360],"li",{},"Select three volunteers, a blind Skeptic, an all-knowing Oracle, and a mathematical Architect.",[358,362,363,364,367],{},"Present a Rubik’s cube to ",[166,365,366],{},"The Architect"," in its solved state.",[358,369,370,372,373,206],{},[166,371,366],{}," will scramble the cube and present it to ",[166,374,341],{},[358,376,377,378,380],{},"The job of ",[166,379,341],{}," is to examine the cube without viewing it.",[358,382,383,385,386,388],{},[166,384,341],{}," may alter the cube, present it to ",[166,387,345],{}," and exclaim\n“O Oracle, tell us, is this the Answer?”.",[358,390,391,393],{},[166,392,345],{}," will respond “Yea!” or “Nay!”.",[159,395,397],{"id":396},"group-theory-combinatorics","Group Theory & Combinatorics",[134,399,400,406],{},[137,401,402],{},[140,403],{"alt":404,"src":405,"target":143},"Carl Sagan","\u002Fassets\u002Fcarl-sagan-cosmos.webp",[145,407,408],{"v-slot:caption":147},[137,409,410,411],{},"Billions & Billons - ",[152,412,404],{"href":413,"rel":414,"target":143},"https:\u002F\u002Fcarlsagan.com\u002F",[156],[137,416,417,418,423,424,427,428,435],{},"There are approximately ",[152,419,422],{"href":420,"rel":421,"target":143},"https:\u002F\u002Fwww.numberphile.com\u002Fvideos\u002F43252003274489856000-rubiks-cube-combinations?rq=rubik",[156],"43 quintillion","\n, or 4.3x10¹⁹, possible permutations of a standard 3x3x3 Rubik’s Cube.\nRegardless, we do know our problem space is a finite group of\npossibilities.\nTo describe a finite group of inputs, ",[166,425,426],{},"preimages",", and their\noutputs, ",[152,429,432],{"href":430,"rel":431,"target":143},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FImage_(mathematics)",[156],[166,433,434],{},"images",",\nwe could pass around a table consisting of all\npossibilities, but that would be very cumbersome.\nInstead, we think about the 43 quintillion possibilities in terms of\nhow we generate the images and how they relate to their preimages.\nThis is the basic explanation of Combinatorics; a study where data\nis deposited into a mystery machine and how the resulting output\nrelates to its input.",[137,437,438],{},"In mathematics & cryptography, we would say our Rubik’s problem is\npreimage-resistant, i.e. it is computationally infeasible to find an\ninput that maps to any pre-specified output.",[159,440,442],{"id":441},"the-cipher","The Cipher",[134,444,445,451],{},[137,446,447],{},[140,448],{"alt":449,"src":450},"Cypher","\u002Fassets\u002Fthe-matrix-cypher.webp",[145,452,453],{"v-slot:caption":147},[137,454,455,456,459,460,462,463,466,467],{},"“Originating from the Sanskrit word for zero शून्य (śuṇya), via the\nArabic word صفر (ṣifr), the word ",[166,457,458],{},"cipher"," spread to Europe as part of\nthe Arabic numeral system during the Middle Ages. [...] The term\n",[166,461,458],{}," was later also used to refer to any Arabic digit [...]\nso encoding text in the form of Arabic numerals is literally\nconverting the text to ",[166,464,465],{},"ciphers",".” - ",[152,468,471],{"href":469,"rel":470,"target":143},"https:\u002F\u002Fen.wikipedia.org\u002Fw\u002Findex.php?title=Cipher&oldid=1340136228",[156],"Wikipedia",[137,473,474,475,477,478,480,481,484,485,488],{},"In cryptography, a ",[166,476,458],{}," is an algorithm or procedure to encrypt or\ndecrypt, more accurately, encode or decode, some plain ole text into\nseemingly indecipherable gibberish.\nFor now, our ",[166,479,458],{}," will be the specific pattern in which the Rubik’s\nCube was scrambled.\nSo we can think of the solved state of our Cube as the “",[166,482,483],{},"plaintext","”,\nand the scrambled state as our “",[166,486,487],{},"ciphertext","”.\nIn other words, the Cube represents a block of data we wish to encrypt.",[159,490,492],{"id":491},"blocks-streams","Blocks & Streams",[137,494,495,496,498,499,501],{},"In cryptography, when we encrypt data, we typically do it one of two\nways, in blocks or in a stream.\nA block ",[166,497,458],{}," encrypts a fixed-length chunk of data to the same\nfixed-length output, but scrambled using some secretive pattern.\nA stream ",[166,500,458],{}," applies the secretive pattern digit by digit; not\nrequiring a certain length input or output.",[137,503,504,505,507,508,510,511,514,515,517,518,520,521,523,524,526,527,530,531,206],{},"Since block ",[166,506,465],{}," operate on a fixed-length of data, what happens\nwhen we have some data left over?\nCould we not simply divide our input data into nice equal chunks?\nYou’re right, this is an old & insecure ",[166,509,458],{}," mode known as ECB\n(Electronic Codebook).\nThe problem with ECB is that it lacks “",[166,512,513],{},"diffusion","”.\nA good ",[166,516,458],{}," will seek to increase the entropy of the produced\n",[166,519,487],{},".\nAn even better ",[166,522,458],{}," will seek to drastically change the output\nof all the ",[166,525,487],{}," when just one bit of the input changes.\nThis is what we call the “",[166,528,529],{},"Avalanche Effect","” in cryptographic ",[166,532,465],{},[137,534,535,536,538],{},"The mural below is built from over 2,800 hand-twisted Rubik’s Cubes.\nUsing ECB to encrypt this mural, changing a single tile in the top\nleft Rubik’s Cube would not result in mutating any other Rubik’s Cube\nin the mural.\nIf you could intercept enough ECB-generated ",[166,537,487],{},", you may\nstatistically reduce your problem space such that it becomes\ncomputationally feasible to bruteforce.",[134,540,541,547],{},[137,542,543],{},[140,544],{"alt":545,"src":546,"target":143},"Embrace Mural by CubeWorks","\u002Fassets\u002Fcube-works-ca-rubiks-embracer-mural.webp",[145,548,549],{"v-slot:caption":147},[137,550,551,552],{},"Embrace by ",[152,553,556],{"href":554,"rel":555,"target":143},"https:\u002F\u002Fcubeworks.ca\u002F",[156],"cubeworks",[137,558,559,560,562,563,566],{},"Our experiment focuses on block ",[166,561,465],{},", mutating chunks of data at a\ntime; so what the Rubik’s actually represents is but one chunk of a\nlarger set of data.\nTo accommodate data that doesn’t fit perfectly into our desired chunks,\nwe just add some “",[166,564,565],{},"padding","”, some random data somewhere to\nensure the length of our output matches the length of our input.",[159,568,570],{"id":569},"a-detour-through-bletchley-park","A Detour Through Bletchley Park",[134,572,573,579],{},[137,574,575],{},[140,576],{"alt":577,"src":578},"The world wonders","\u002Fassets\u002Fnimitz-and-halsey-1943.webp",[145,580,581],{"v-slot:caption":147},[137,582,583],{},"TURKEY TROTS TO WATER GG FROM CINCPAC ACTION COM THIRD FLEET INFO\nCOMINCH CTF SEVENTY-SEVEN X WHERE IS RPT WHERE IS TASK FORCE THIRTY\nFOUR RR THE WORLD WONDERS",[137,585,586,587,590,591,596],{},"On October 25, 1944, during the Battle of Leyte Gulf, U.S. Fleet\nAdmiral Chester Nimitz sent an encoded message ending with “the world\nwonders”. The phrase was intended to be nonsensical, as it was a form\nof cryptographically padding messages to make cryptanalysis more\ndifficult.\nUpon decoding the message, the radio officer of Admiral William Halsey\nJr removed the opening padding of “",[166,588,589],{},"turkey trots to water","”; however,\nleft the final padding in confusion.\nAs a result, Halsey misunderstood the message as an admonishment.\nHalsey had made the choice to abandon the role of covering\nlanding-invasion forces to pursue a fleet of carriers that were later\ndiscovered to be decoys.\nThe misunderstood message lead Halsey to abandon the chase and return\nto the ",[152,592,595],{"href":593,"rel":594,"target":143},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBattle_off_Samar",[156],"Battle off Samar",",\nalbeit, too late to have much of an impact.",[137,598,599,600,603,604,607,608,610,611,614,615,617],{},"You see the code breakers at England’s Bletchley Park, Alan Turing, et\nal., had been making use of “",[166,601,602],{},"cribs","”, what cryptanalysts refer to as a\n“",[166,605,606],{},"known-plaintext attack","”.\nTo determine the ",[166,609,458],{}," pattern used, they assumed messages would have\ncommon phrases at the beginning and end, e.g. “Dear” or “Sincerely”.\nIdentifying a ",[166,612,613],{},"crib"," string of “Qrne” at the beginning of a message might\nreveal the ",[166,616,458],{}," used was ROT13.\nAs such, it was a required procedure of the U.S Navy to pad all\nmessages.",[159,619,621],{"id":620},"the-padding-oracle","The Padding Oracle",[137,623,624],{},"Going back to our experiment, we now understand that our Rubik’s\nCube represents a block of data that may include some padding.\nBut how can we avoid the folly of Halsey?\nWhat is legitimate data and what is just left-over random noise to\nmeet our required block-size?",[137,626,627,628,630,631,633,634,636,637,640,641,643,644,646],{},"Well simply put, ",[166,629,345],{}," will enlighten ",[166,632,341],{},".\nWhen ",[166,635,366],{}," encrypts or scrambles the Rubik’s Cube, ",[166,638,639],{},"The\nOracle"," will count each move used to transform the ",[166,642,483],{}," to the\n",[166,645,487],{},"; from the Rubik’s Cube solved state to the scrambled state.",[137,648,649,650,652,653,655,656,658,659,661,662,664],{},"When ",[166,651,341],{}," presents their Cube, ",[166,654,345],{}," will now respond\nwith “Yea!”, “Nay!”, or “Wrong Padding!”.\nSo what strategy might our ",[166,657,326],{}," adopt to reduce their problem space?\n",[166,660,341],{}," will first aim to identify how many moves were used by\n",[166,663,366],{}," to scramble the Cube.\nNow let’s imagine this particular block of data only has a single byte\nof plaintext, the rest is padding.\nIn our Rubik’s Cube toy model, we will consider a single byte a single\nmove.\nFor our padding, we will use all zeros, i.e. we will not make any\nadditional moves.",[137,666,667],{},"In a single move, we have 8 corners that can be oriented in 3 ways,\nbut only 7 can be oriented independently.\nWe have 12 edges that can be flipped, but only 11 may be flipped\nindependently.\nNot withstanding symmetry, we are left with 3⁷ and 2¹¹, or 4,235\npossibilities for a single move.\nA far cry from the 43 quintillion problem space we began with, and\ncertainly not what we would consider computationally infeasible.",[159,669,671],{"id":670},"record-splitting","Record Splitting",[137,673,674],{},"So we can see how Padding Oracle attacks can drastically reduce our\nproblem space when majority of the message is padding, but what if\nmore moves were required and less padding was used?\nWe may easily be back to our 43 quintillion possibilities.",[137,676,677,678,680,681,683],{},"Often times in cryptography, while ",[166,679,341],{}," does not know the\n",[166,682,458],{},", they may be given control of what data is encrypted and how\nmuch.\nConsider the following:",[355,685,686,691,696],{},[358,687,688,690],{},[166,689,341],{}," knows the size of the block as they hold it in their hand.",[358,692,693,695],{},[166,694,341],{}," can prefix additional moves, i.e. data.",[358,697,698,699,701],{},"As before, ",[166,700,345],{},", when presented with the last block of data, will\nproclaim “Wrong Padding!” if the wrong amount of moves are made.",[137,703,704,705,707,708,710],{},"The goal of ",[166,706,341],{}," is now to ensure that the total moves will\nalways end with a remainder of 1, ensuring a reduction of the problem\nspace to 4,235, allowing a computationally feasible brutefoce of the\n",[166,709,458],{},", which may then be applied to previous blocks of data that\nrequired no padding.",[159,712,714],{"id":713},"thats-cheating","That’s Cheating",[137,716,717,718,720,721,723,724,726],{},"In practice, what does it look like to allow ",[166,719,341],{}," to control\nthe number of moves?\nIn many applications, ",[166,722,483],{}," provided or controlled by the client\nwill be turned to ",[166,725,487],{},".\nThis might be the users email or name, URI parameters, or even an\norder number.",[159,728,730],{"id":729},"initializing-legs","Initializing Legs",[137,732,733,734,736,737,739,740,742,743,745],{},"Our Rubik’s Cow still looks a bit funny.\nPreviously, we thought of our ",[166,735,458],{}," as the pattern of each twist\nand turn the ",[166,738,334],{}," applied to the Cube; however, we shouldn’t\nthink of our ",[166,741,458],{},", the encoding algorithm, as a key.\nWe want to stick with a concrete, well-researched, algorithm that\nguarantees great confusion and diffusion in the ",[166,744,487],{}," we\noutput; not pick a new one each time, that perhaps may not be as\ncomputationally resilient.",[137,747,748,749,751,752,755,756,758,759,762,763,765,766,768,769,771,772,775],{},"Instead of starting with a solved Cube, the ",[166,750,334],{}," will randomly\ntwist and turn the Cube 20 times.\nThis is what we call the ",[166,753,754],{},"Initialization Vector",", seed, or nonce.\nWe write our ",[166,757,483],{}," data on-top of this nonce, consequently\ninterleaving our data; i.e. XOR’ing or bit-flipping.\nFor the next block, we could use the same ",[166,760,761],{},"IV",", but we achieve greater\ndiffusion by chaining the blocks together.\nSo our ",[166,764,761],{}," for the next block is the ",[166,767,487],{}," output of the previous\n",[166,770,483],{}," input block, what is referred to as ",[166,773,774],{},"residue",", causing a\ncascading avalanche of bit-flips should one bit in the chain differ.",[159,777,779],{"id":778},"whoa-there","Whoa There!",[137,781,782,786,787,791],{},[140,783],{"alt":784,"src":785},"Whoa","\u002Fassets\u002Fthe-matrix-neo-whoa.webp","\nHold your ",[788,789,790],"del",{},"horses"," cows! Can you spot the flaw in our chaining?",[355,793,794,798,802],{},[358,795,796,690],{},[166,797,341],{},[358,799,800,695],{},[166,801,341],{},[358,803,804,805,807,808,810],{},"The ",[166,806,761],{}," for all subsequent blocks is the ",[166,809,774],{}," of the previous.",[137,812,813,814,816,817,819,820,824,825,828,829,831],{},"As a result, ",[166,815,341],{}," can control the ",[166,818,761],{}," for all blocks of data,\n",[821,822,823],"strong",{},"except"," the first block.\nThat’s not very helpful, ",[821,826,827],{},"unless",", we, I don’t know, used a implicit\nor fixed ",[166,830,761],{}," for the first block. Welp.",[833,834,836,839],"block-quote",{"link":835},"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc4346#section-6.2.3.2",[137,837,838],{},"Unlike previous versions of SSL and TLS, TLS 1.1 uses an explicit\nIV in order to prevent the attacks described by [CBCATT].\nIn prior versions of TLS, there was no IV field and the CBC\nresidue and mask were one and the same.",[145,840,841],{"v-slot:cite":147},[137,842,843],{},"RFC 4346 Section 6.2.3.2",[137,845,846,847,849,850,852,853,856,857,862,863,866,867,206],{},"So if an attacker can intercept the first block of a connection, they\nhad the potential to control the ",[166,848,761],{}," of all subsequent blocks of all\nsubsequent messages, as the ",[166,851,761],{}," was implicitly determined from other\nparameters such as the connection state and sequence counters.\nTLS 1.1 and later now requires that all subsequent ",[166,854,855],{},"IV’s"," are random.\nThis is 2011’s ",[152,858,861],{"href":859,"rel":860,"target":143},"https:\u002F\u002Fcommandlinefanatic.com\u002Fcgi-bin\u002Fshowarticle.cgi?article=art027",[156],"BEAST Attack",",\nor ",[166,864,865],{},"Browser Exploit Against SSL\u002FTLS",".\nHere is a really great article explaining the attack, from the\n",[152,868,871],{"href":869,"rel":870,"target":143},"https:\u002F\u002Fblog.torproject.org\u002Ftor-and-beast-ssl-attack\u002F",[156],"Tor Project",[159,873,345],{"id":874},"the-oracle",[134,876,877,883],{},[137,878,879],{},[140,880],{"alt":881,"src":882},"The Oracle as portrayed by Gloria Foster from 1999’s The Matrix","\u002Fassets\u002Fthe-matrix-oracle-gloria-foster.webp",[145,884,885],{"v-slot:caption":147},[137,886,887],{},"“Sorry, kid. You got the gift, but it looks like you're waiting for something. Your next life, maybe. Who knows?”",[137,889,890,891,893,894,897,898,900,901,903,904,906,907,909],{},"If you got this far, you are probably more than familiar with Neo’s\nrole in ",[166,892,168],{},".\nNeo is ",[166,895,896],{},"The One",", a statistically unavoidable remainder of a complex\nalgorithm that arrives approximately every 100 years; a summation of\nanomalies in an equation that balances Man and Machine.\nOriginally, this anomaly was encountered much sooner in earlier\nversions of ",[166,899,168],{},".\nRather than root out the anomaly, ",[166,902,366],{}," aims to change the\ndirective of Neo.\nThe destiny of ",[166,905,896],{}," is not to destroy ",[166,908,168],{},", but to save\nHumanity.",[833,911,913,916],{"link":912},"https:\u002F\u002Fmatrix.fandom.com\u002Fwiki\u002FThe_Architect",[137,914,915],{},"Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the matrix.\nYou are the eventuality of an anomaly, which despite my sincerest efforts I have been unable to eliminate from what is otherwise a harmony of mathematical precision.",[145,917,918],{"v-slot:cite":147},[137,919,366],{},[137,921,922,923,925,926,929,930,932,933,936,937,939,940,942,943,945,946,948],{},"Controlling ",[166,924,896],{}," was outside of ",[166,927,928],{},"The Machines’"," capabilities, as\n",[166,931,896],{}," represents an amalgamation of Man and Machine, the physical\nand the metaphysical.\n",[166,934,935],{},"The Machines"," intended ",[166,938,345],{}," to be a form of control over\nHumanity.\n",[166,941,345],{}," would guide ",[166,944,896],{}," to a gambit paraded as an illusion\nof free will, where ",[166,947,935],{}," assumed they could exploit Neo’s\nHuman condition, a vulnerability to influence the perpetual\nenslavement of Humanity.",[950,951,952],"style",{},"html pre.shiki code .stHQG, html code.shiki .stHQG{--shiki-default:#00DAEF}html pre.shiki code .se2J0, html code.shiki .se2J0{--shiki-default:#FFD493}html pre.shiki code .sLo_3, html code.shiki .sLo_3{--shiki-default:#EEF0F9}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);}",{"title":147,"searchDepth":231,"depth":231,"links":954},[955,956,957,958,959,960,961,962,963,964,965,966,967],{"id":161,"depth":231,"text":157},{"id":319,"depth":231,"text":320},{"id":352,"depth":231,"text":353},{"id":396,"depth":231,"text":397},{"id":441,"depth":231,"text":442},{"id":491,"depth":231,"text":492},{"id":569,"depth":231,"text":570},{"id":620,"depth":231,"text":621},{"id":670,"depth":231,"text":671},{"id":713,"depth":231,"text":714},{"id":729,"depth":231,"text":730},{"id":778,"depth":231,"text":779},{"id":874,"depth":231,"text":345},{},true,{"title":48,"description":82},"blog\u002Fpadding-oracle-attacks-rubiks-cow",[84],{"sm":86,"md":87,"lg":88},null,"pcMvdJJlxLZ829zjv7fydRN7b6ONgc2QFZtuKy9xIgk",[],{"id":4,"title":5,"author":978,"description":14,"extension":15,"meta":979,"repository":980,"stem":21,"__hash__":22},{"name":7,"github":8,"gitlab":9,"email":10,"linkedin":11,"mastodon":12,"bio":13},{},{"url":18,"git":19,"branch":20},1793313045135]