<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[emdeh’s Substack: Explainers]]></title><description><![CDATA[Short explainers on technical topics.]]></description><link>https://www.emdeh.com/s/explainers</link><image><url>https://substackcdn.com/image/fetch/$s_!ZFh2!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e3ab64a-692c-4b46-903b-f8cbe66d9aba_144x144.png</url><title>emdeh’s Substack: Explainers</title><link>https://www.emdeh.com/s/explainers</link></image><generator>Substack</generator><lastBuildDate>Tue, 28 Jul 2026 15:56:52 GMT</lastBuildDate><atom:link href="https://www.emdeh.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[emdeh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[emdeh@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[emdeh@substack.com]]></itunes:email><itunes:name><![CDATA[emdeh]]></itunes:name></itunes:owner><itunes:author><![CDATA[emdeh]]></itunes:author><googleplay:owner><![CDATA[emdeh@substack.com]]></googleplay:owner><googleplay:email><![CDATA[emdeh@substack.com]]></googleplay:email><googleplay:author><![CDATA[emdeh]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Port Forwarding & SSH Tunneling]]></title><description><![CDATA[A Pivoting Quick Reference]]></description><link>https://www.emdeh.com/p/port-forwarding-and-ssh-tunneling</link><guid isPermaLink="false">https://www.emdeh.com/p/port-forwarding-and-ssh-tunneling</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Fri, 24 Jul 2026 05:02:04 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1dd5e827-6ea4-4d67-bc46-60999747cd3f_2760x1580.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If, like me, you&#8217;ve ever stared at an <code>ssh -R</code> command and asked, &#8220;Wait, which side is listening again?&#8221; then read on. Port forwarding techniques all do the same basic thing (move traffic from A to B through some intermediary), but they differ in <strong>where the listening port lives</strong> and <strong>which direction traffic gets pushed</strong>. Get that straight, and the syntax starts making sense.</p><h2>The one idea that fixes most of the confusion</h2><p>Every forwarding setup has three roles:</p><ul><li><p><strong>Listener</strong>: the socket that <em>receives</em> the initial connection. Something connects <em>to</em> it.</p></li><li><p><strong>Forwarder</strong>: the process that takes what hits the listener and pushes it somewhere else.</p></li><li><p><strong>Destination</strong>: the final service you actually want to talk to (a database, RDP, SMB, etc.).</p></li></ul><p>The trap is assuming the listener is always on your local machine, or always on the target. This isn&#8217;t the case. In SSH tunnelling specifically, the SSH <strong>client</strong> and SSH <strong>server</strong> roles are about who initiated the SSH connection, and that is <em>independent</em> of which of them ends up hosting the listening port. Local vs. remote forwarding is entirely about that pairing. Once you interrogate &#8220;who is the SSH client here, who is the SSH server, and which one is listening,&#8221; the rest is just filling in IP: port pairs correctly.</p><h2>Scenario setup</h2><p>Assume a foothold on a compromised app server we&#8217;ll call <strong>JUMPBOX01</strong> (192.168.60.50), sitting between our Kali machine (192.168.120.5) and a database host on an internal segment, <strong>DBHOST02</strong> (10.10.20.30), which is only reachable from <strong>JUMPBOX01</strong>.</p><div><hr></div><h2>1. Socat &#8212; dumbest, fastest port forward</h2><p>No SSH involved - relays TCP. Run this on the intermediary host (<strong>JUMPBOX01</strong>):</p><pre><code><code>socat -ddd TCP-LISTEN:2345,fork TCP:10.10.20.30:5432</code></code></pre><ul><li><p>Listener: port 2345 on <strong>JUMPBOX01</strong>.</p></li><li><p>Forwarder: socat itself.</p></li><li><p>Destination: port 5432 (Postgres) on <strong>DBHOST02</strong>.</p></li></ul><p>From Kali, connect to <strong>JUMPBOX01</strong>&#8217;s IP on the listening port, and it&#8217;s transparently pushed to <strong>DBHOST02</strong>:</p><pre><code><code>psql -h 192.168.60.50 -p 2345 -U postgres</code></code></pre><p>Good for a quick, disposable relay but is weak on stealth. An odd listening port is easy to spot with basic monitoring, so it&#8217;s more suited to noisy, time-boxed lab work than an actual engagement.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vnQg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vnQg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 424w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 848w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 1272w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vnQg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png" width="818" height="308" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/da27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45894,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/208162860?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vnQg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 424w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 848w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 1272w, https://substackcdn.com/image/fetch/$s_!vnQg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fda27c9c7-c54b-4840-a9b6-87c1d880297d_818x308.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>2. SSH Local Port Forwarding (<code>-L</code>)</h2><p><strong>Mental model:</strong> &#8220;I (the SSH client) want to open <em>my door</em> that tunnels to something the SSH server can reach.&#8221;</p><p>Syntax:</p><pre><code><code>ssh -N -L [LISTEN_IP:]LISTEN_PORT:DEST_IP:DEST_PORT user@SSH_SERVER</code></code></pre><ul><li><p>The listener binds on the <strong>SSH client</strong> machine.</p></li><li><p>Traffic goes: client listener &#8594; tunnel &#8594; SSH server &#8594; destination.</p></li></ul><p>Say we&#8217;re SSH&#8217;d from <strong>JUMPBOX01</strong> out to <strong>DBHOST02</strong> (DBHOST02 is the SSH server here), and we&#8217;ve found a third host, <strong>FILESRV03</strong> (172.20.10.40), reachable only from <strong>DBHOST02</strong> with SMB open on 445:</p><pre><code><code>ssh -N -L 0.0.0.0:4455:172.20.10.40:445 svc_admin@10.10.20.30</code></code></pre><p>The way I like to think of this is: &#8220;<em>from </em>0.0.0.0:4455, <em>via </em>svc_admin@10.10.20.30, <em>to </em>172.20.10.40:445&#8221;.</p><p>From Kali, connect to <strong>JUMPBOX01</strong>&#8217;s IP on the listener port, and the traffic will be tunnelled through to <strong>DBHOST02</strong> and pushed to <strong>FILESRV03</strong> on port 445:</p><pre><code><code>smbclient //192.168.60.50/share -p 4455</code></code></pre><p><strong>When to use it:</strong> you know exactly one destination socket you want to reach, and you&#8217;re fine opening just that one door.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vn1p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vn1p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 424w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 848w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 1272w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vn1p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png" width="821" height="312" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b48d5636-deae-4116-b009-c5d081b90550_821x312.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:312,&quot;width&quot;:821,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60062,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/208162860?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Vn1p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 424w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 848w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 1272w, https://substackcdn.com/image/fetch/$s_!Vn1p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb48d5636-deae-4116-b009-c5d081b90550_821x312.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>3. SSH Dynamic Port Forwarding (<code>-D</code>) - the SOCKS proxy</h2><p><strong>Mental model:</strong> Same direction as local forwarding (client listens, server routes), but instead of hardcoding one destination, you get a full SOCKS proxy. Anything the SSH server can route to, you can now reach.</p><pre><code><code>ssh -N -D 0.0.0.0:9999 svc_admin@10.10.20.30</code></code></pre><p>Point <code>proxychains</code> at it (<code>/etc/proxychains4.conf</code>):</p><pre><code><code>[ProxyList]
socks5 192.168.60.50 9999</code></code></pre><p>Then run any tool through the tunnel, and traffic will be routed as addressed.</p><pre><code><code>proxychains nmap -sT --top-ports=20 -Pn -n 172.20.10.40</code></code></pre><blockquote><p>Drop the <code>tcp_read_time_out</code> / <code>tcp_connect_time_out</code> values in proxychains&#8217; config if scans feel painfully slow; the defaults are tuned for Tor, not internal pivoting.</p></blockquote><p><strong>When to use it:</strong> you don&#8217;t know the full target list yet, or you need to reach several hosts/ports beyond the pivot without opening a new forward for each one.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZNRd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZNRd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 424w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 848w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 1272w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZNRd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png" width="735" height="281" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34c082d7-3120-44b4-881a-8185256de6b3_735x281.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:281,&quot;width&quot;:735,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:57868,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/208162860?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZNRd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 424w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 848w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 1272w, https://substackcdn.com/image/fetch/$s_!ZNRd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34c082d7-3120-44b4-881a-8185256de6b3_735x281.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>4. SSH Remote Port Forwarding (<code>-R</code>)</h2><p><strong>Mental model:</strong> This flips the listener to the <em>other side</em>. &#8220;I am the <strong>SSH client</strong>, but I want the <strong>SSH server</strong> to open the door, and I (the client) will do the forwarding back to something only I can reach.&#8221;</p><p>This is the pivot equivalent of a reverse shell and is useful when the compromised host can reach out, but nothing can reach in.</p><pre><code><code>ssh -N -R [BIND_IP:]LISTEN_PORT:DEST_IP:DEST_PORT user@SSH_SERVER_YOU_CONTROL</code></code></pre><p>Say your foothold is on <strong>JUMPBOX01</strong>, and <strong>JUMPBOX01</strong> can dial out to your Kali box (192.168.120.5), which is running <code>sshd</code>. From <strong>JUMPBOX01</strong> (acting as SSH <em>client</em> here):</p><pre><code><code>ssh -N -R 127.0.0.1:2345:10.10.20.30:5432 kali@192.168.120.5</code></code></pre><ul><li><p>Listener: port 2345, bound on <strong>Kali</strong> (the SSH server in this exchange) &#8212; loopback.</p></li><li><p>Forwarder: the SSH client software running on <strong>JUMPBOX01</strong>.</p></li><li><p>Destination: <strong>DBHOST02:5432</strong>, reachable from <strong>JUMPBOX01</strong>.</p></li></ul><p>The part that sometimes trips me up is even though <em>you</em> set this up from <strong>JUMPBOX01</strong>, the port you actually connect to afterwards is on <strong>your own Kali box</strong>, not <strong>JUMPBOX01</strong>. The whole point of &#8220;remote&#8221; forwarding is the listener lives remotely, relative to where you typed the command.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1Nhr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1Nhr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 424w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 848w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 1272w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1Nhr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png" width="757" height="286" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:286,&quot;width&quot;:757,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45801,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/208162860?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1Nhr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 424w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 848w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 1272w, https://substackcdn.com/image/fetch/$s_!1Nhr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c004f50-6a0c-4bd0-b311-839441e8f69d_757x286.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>5. SSH Remote Dynamic Port Forwarding</h2><p>Same flip as above, but SOCKS-flavoured instead of one fixed destination. Only needs one thing: the port to bind on the SSH server:</p><pre><code><code>ssh -N -R 9998 kali@192.168.120.5</code></code></pre><p>Update <code>/etc/proxychains4.conf</code>:</p><pre><code><code>socks5 127.0.0.1 9998</code></code></pre><p>Now, from Kali, <code>proxychains nmap</code> or any other tool can reach anything <strong>JUMPBOX01</strong> can route to without needing to know the destinations in advance:</p><pre><code><code>proxychains nmap -vvv -sT --top-ports=20 -Pn -n 10.10.20.30</code></code></pre><p><strong>When to use it:</strong> You&#8217;re pivoting <em>deeper</em> through a host that can only reach you outbound, and you don&#8217;t yet know the full internal target list.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R37B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R37B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 424w, https://substackcdn.com/image/fetch/$s_!R37B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 848w, https://substackcdn.com/image/fetch/$s_!R37B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 1272w, https://substackcdn.com/image/fetch/$s_!R37B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R37B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png" width="758" height="284" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:284,&quot;width&quot;:758,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49080,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/208162860?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R37B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 424w, https://substackcdn.com/image/fetch/$s_!R37B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 848w, https://substackcdn.com/image/fetch/$s_!R37B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 1272w, https://substackcdn.com/image/fetch/$s_!R37B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbfdab6a1-8c65-44ca-b74e-235e8a1cd0d3_758x284.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>The fastest way to stop second-guessing syntax mid-engagement: before typing anything, say out loud &#8220;the listener is on ___, and it forwards to ___.&#8221; If you can&#8217;t fill in both blanks confidently, you&#8217;re not ready to type the command yet.</p>]]></content:encoded></item><item><title><![CDATA[The 2048-bit key that wasn't]]></title><description><![CDATA[Mistaking one 2048-bit number for another.]]></description><link>https://www.emdeh.com/p/the-2048-bit-key-that-wasnt</link><guid isPermaLink="false">https://www.emdeh.com/p/the-2048-bit-key-that-wasnt</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Tue, 21 Jul 2026 11:26:48 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b640c922-e4fc-4c8d-a1ef-22b18f1e53bf_2760x1640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recently, I was reviewing evidence for a control assessment. The control in question was ISM-0472:</p><blockquote><p><em>When using DH for agreeing on encryption session keys, a modulus of at least 2048 bits is used, preferably 3072 bits.</em></p></blockquote><p>The evidence I&#8217;d been handed was a screenshot of a server&#8217;s TLS certificate, showing a 2048-bit RSA public key, similar to the one below:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E0Tq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E0Tq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 424w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 848w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 1272w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E0Tq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png" width="545" height="567" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:567,&quot;width&quot;:545,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:58957,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.emdeh.com/i/207419085?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E0Tq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 424w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 848w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 1272w, https://substackcdn.com/image/fetch/$s_!E0Tq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b904fff-2366-4c63-98b0-5952cddbffe8_545x567.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At first glance it might look right, but it wasn&#8217;t evidence for ISM-0472 at all. Both things involve the word &#8220;modulus&#8221; and the number 2048, which is why this mix-up is so easy to make until you&#8217;ve sat down and pulled the two apart. So let&#8217;s pull them apart.</p><h2>Two different jobs, two different keys</h2><p>A TLS handshake actually needs to do two separate jobs:</p><p>1. <strong>Prove identity.</strong> The server needs to convince you it really is who it says it is. This is what the TLS certificate, like the screenshot above, is for. It contains a public key (often RSA, sometimes EC) that the server uses to sign parts of the handshake, proving it holds the matching private key.</p><p>2. <strong>Agree on a session key.</strong> Separately, the client and server need to agree on a fresh secret to encrypt the actual traffic for the session. If they&#8217;re using Diffie-Hellman (DH) to do this, that process involves its own key material, also known as a &#8220;temp key&#8221; or ephemeral key. Crucially, this has nothing to do with the certificate.</p><p>These are two different keys, generated for two different purposes. Importantly, <strong>there is no relationship between their sizes</strong>. A server can hand you a 4096-bit certificate for authentication and still negotiate a 1024-bit DH group for the session key. </p><p>That mismatch is, in fact, close to the basis of a real vulnerability class (<a href="https://nvd.nist.gov/vuln/detail/CVE-2015-4000">Logjam, 2015</a>), where servers supporting legacy export-grade DHE ciphers could be forced down to a 512-bit DH group, and where widespread reuse of the same standard primes meant one precomputation could compromise many servers at once. A strong certificate never told you any of that.</p><p>So the screenshot showed the RSA modulus of the certificate&#8217;s public key. Good evidence of authentication strength, but ISM-0472 is asking about the modulus used to derive the <em><strong>session key</strong></em>. In other words, the key used to encrypt the session traffic between the server and the client. Same word, same number, completely different thing. The evidence didn&#8217;t touch the control it was meant to support.</p><h2>What &#8220;modulus&#8221; actually refers to in each case</h2><p>It&#8217;s worth being precise here about what the term &#8220;modulus&#8221; actually means.</p><ul><li><p><strong>Certificate / RSA modulus:</strong> this is the large number <em>n</em> that forms part of an RSA public key (<em>n</em> = <em>p</em> &#215; <em>q</em>, two large primes). Its bit-length is what people mean when they say &#8220;2048-bit certificate&#8221; or &#8220;2048-bit key.&#8221; It&#8217;s baked into the cert and doesn&#8217;t change per session.</p></li><li><p><strong>DH modulus:</strong> this is the large prime <em>p</em> that defines the finite field the Diffie-Hellman exchange operates over. When DH is ephemeral (DHE), this prime is chosen or negotiated fresh, often for each session, and it's this value, not anything in the certificate, that ISM-0472 is actually asking about.</p></li></ul><h2>Seeing the difference yourself</h2><p>The cleanest way to internalise this is to force a handshake and look at both values side by side. You&#8217;ll need a Linux box with OpenSSL to follow along. This is entirely self-contained, so no need to go hunting for a public server that still does classic DHE (more on why that&#8217;s hard, shortly).</p><p>1. Generate a cert and a DH group, then start a test server:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;0ad833a5-bce0-4fd7-b8e5-f5fbd4768457&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash"># The following command generates a self-signed cert with a 2048-bit RSA key.
# This is the &#8220;authentication&#8221; key.
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem \
-days 7 -nodes -subj "/CN=test"

# The following command generates a 2048-bit DH parameter file. 
# This defines the DH modulus.
openssl dhparam -out dhparam2048.pem 2048

# The following starts a bare TLS server, forcing TLS 1.2 + DHE so nothing 
# negotiates around it.
openssl s_server -accept 4433 -cert cert.pem -key key.pem \
-dhparam dhparam2048.pem -no_tls1_3 -cipher 'DHE'</code></pre></div><p>2. In a second terminal, connect and inspect both values:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;3a470f39-8d3d-477a-b454-7ef529e70ef8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">openssl s_client -connect localhost:4433 -tls1_2 -cipher 'DHE' \
&lt; /dev/null 2&gt;/dev/null | grep -E "Temp Key|Server public key"</code></pre></div><p>You&#8217;ll see something like:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;4ae7bbc0-fbc5-4fe4-a520-8807104b43a5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">Peer Temp Key: DH, 2048 bits
Server public key is 2048 bit</code></pre></div><p>Two lines, two different keys, coincidentally matching. Now change just one of them and regenerate the DH params at 1024 bits and point the server at that file instead, and reconnect:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;0d7e186a-1820-4409-99db-a1c26e53567f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash"># The following command generates a 1024-bit DH parameter file. 
openssl dhparam -out dhparam1024.pem 1024

# The following command restarts the TLS server 
# but with the 1024-bit DH parameter file. 
openssl s_server -accept 4433 -cert cert.pem -key key.pem \
-dhparam dhparam1024.pem -no_tls1_3 -cipher 'DHE:@SECLEVEL=0'

# Note that you will need to force the weak key with `-cipher 'DHE:@SECLEVEL=0'`</code></pre></div><p>Back in the other terminal (e.g., the &#8220;client side&#8221;), re-run the query:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:null}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">openssl s_client -connect localhost:4433 -tls1_2 -cipher 'DHE:@SECLEVEL=0' \
&lt; /dev/null 2&gt;/dev/null | grep -E "Temp Key|Server public key"

# Note you need to force the weak cipher here too.</code></pre></div><p>You will see:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;0d7e186a-1820-4409-99db-a1c26e53567f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">Peer Temp Key: DH, 1024 bits
Server public key is 2048 bit</code></pre></div><p>Same certificate. Same authentication strength. But the session key is now being negotiated over a modulus half the size. This demonstrates the gap the original evidence missed; nothing about the cert tells you what&#8217;s happening on that second line.</p><h2>Where TLS 1.3 and ECDHE fit in</h2><p>If you try to reproduce this against a real-world site instead of your own test server, you&#8217;ll almost certainly fail to find classic DH at all, and that&#8217;s the scenario worth paying attention to.</p><p>Most modern servers prefer elliptic-curve Diffie-Hellman (ECDHE) over classic finite-field DHE. It&#8217;s the same idea in terms of negotiating an ephemeral key exchange for the session, but the mathematics runs on an elliptic curve rather than a large prime field. Instead of a &#8220;modulus,&#8221; you&#8217;ll see something like:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;ea216d57-1cb6-4b17-9762-56d9b8da7571&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">Server Temp Key: X25519, 253 bits</code></pre></div><p>That 253-bit figure isn&#8217;t directly comparable to a DH bit-length because elliptic curve math is far more efficient per bit. X25519 at 253 bits offers strength roughly on par with a 3000+ bit finite-field DH group. It&#8217;s arguably better than what ISM-0472 asks for. But it&#8217;s also a different mechanism entirely, so strictly speaking it falls outside ISM-0472&#8217;s scope (there&#8217;s likely a separate control for elliptic-curve parameters instead).</p><p>There&#8217;s a catch though: <em><strong>a server can support both</strong></em>. Under TLS 1.2, a server&#8217;s configuration can list ECDHE cipher suites <em>and</em> older DHE cipher suites side by side. </p><p>A default scan of the handshake will show ECDHE negotiated, because it&#8217;s preferred. But that doesn&#8217;t mean DHE isn&#8217;t still sitting in the config underneath, pointing at whatever DH parameters were set up years ago and never revisited. If nothing modern ever picks that path, nobody ever notices it as potentially weak. An assessor who only captures the default handshake and sees ECDHE could reasonably, but wrongly, conclude there&#8217;s no DH modulus to worry about at all.</p><p>You can prove this to yourself with the same test server, configured to allow both:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;82f04406-96c6-4cce-b9c5-d134e258dbfd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash"># Reuse the earlier cert, but point at the 2048-bit DH param file this time.
# Note we are using the 2048-bit DH param here instead
# of a 1024-bit to avoid the SECLEVEL quirk.

# Start the server allowing BOTH ECDHE and DHE cipher suites:
# no restriction to DHE only
openssl s_server -accept 4433 -cert cert.pem -key key.pem \
-dhparam dhparam2048.pem -no_tls1_3 -cipher 'ECDHE:DHE:@SECLEVEL=1'</code></pre></div><p>Connect with an unrestricted client first. This is what a routine scan captures by default:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;ff2b0833-3f31-4fdb-9f35-f3deaa9e7ea5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">openssl s_client -connect localhost:4433 -tls1_2 &lt; /dev/null 2&gt;/dev/null \
| grep "Temp Key"</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;966ca290-c75c-41bf-bc00-2da4c4a42789&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">Peer Temp Key: X25519, 253 bits</code></pre></div><p>Looks fine. Nothing to flag. Now force DHE specifically, to check what&#8217;s sitting underneath:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;19efa099-fd03-49d1-a6e8-43cfbbe506ce&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">openssl s_client -connect localhost:4433 -tls1_2 -cipher 'DHE' \
&lt; /dev/null 2&gt;/dev/null | grep "Temp Key"</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;f3e54b33-4901-4f1b-bf78-ada974bddf05&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Peer Temp Key: DH, 2048 bits</code></pre></div><p>Same server, same configuration, but two entirely different results depending only on which cipher suite gets negotiated. The first connection alone would have signed off on ISM-0472 as not applicable, but the second demonstrates that it does apply. </p><h3>What about TLS 1.3?</h3><p>TLS 1.3 removes this risk entirely, which is worth knowing about because it changed how DH is allowed to work. A TLS 1.2 server could hand the client any arbitrary DH prime it liked, which is how weak, sometimes reused, primes ended up in production undetected in the first place. TLS 1.3 only permits DH via a small set of pre-vetted groups, all 2048 bits or larger, so weaker moduli are architecturally impossible under TLS 1.3. </p><p>If a TLS 1.3 handshake negotiates DH at all, it&#8217;s already 0472-compliant by construction. The catch is that almost nobody implements it, as most stacks only wire up ECDHE for TLS 1.3, so a TLS 1.3 connection using classic DH at all is rare in practice. It&#8217;s TLS 1.2, still very much alive for backward compatibility, where the real risk sits.</p><h3>The practical takeaway for an assessment</h3><p>Put together, this gives you a decision path for actually testing this control properly:</p><ul><li><p><strong>Enumerate everything the server supports</strong>, not just what a modern client negotiates by default. A tool like <code>nmap &#8212;script ssl-enum-ciphers</code> will show you the full cipher suite list, including any DHE suites that exist purely for backward compatibility but never get chosen in practice.</p></li><li><p><strong>If no DHE suites exist at all and the server only does ECDHE</strong>, then ISM-0472 doesn&#8217;t apply to the system; there&#8217;s no DH modulus in play anywhere.</p></li><li><p><strong>If DHE suites are present alongside ECDHE</strong>, don&#8217;t assume the default handshake tells the whole story. Force DHE explicitly (as shown above) and check what modulus size it actually falls back to. This is precisely the scenario just demonstrated. ECDHE is shown by default, but a DH group is still configured and reachable underneath.</p></li><li><p><strong>Even a &#8220;pass&#8221; here can come with a stronger recommendation</strong>. If DHE is present and checks out at 2048-bit or higher, that's technically compliant as far as ISM-0472 is concerned. But if every real client already supports ECDHE, nothing is actually relying on that DHE fallback, so the tighter finding is often &#8220;disable DHE entirely&#8221; rather than &#8220;leave it, it's compliant.&#8221;</p></li></ul><p>None of this is really about DH being unusual or obscure. It's a reminder that <em>&#8220;a strong key is present&#8221;</em> and <em>&#8220;the specific key this control asks about is strong&#8221;</em> are two different claims, and it's worth knowing which one your evidence is actually making.</p>]]></content:encoded></item><item><title><![CDATA[Linear Transformation and Matrices]]></title><description><![CDATA[Matrix addition and, scalar and square matrices multiplication.]]></description><link>https://www.emdeh.com/p/linear-transformation-and-matrices</link><guid isPermaLink="false">https://www.emdeh.com/p/linear-transformation-and-matrices</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Tue, 20 Aug 2024 23:49:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>What&#8217;s a Matrix?</h1><p>A <strong>matrix </strong>is a two-dimensional array that contains the same elements as the vector. A matrix can have <em>m </em>rows and <em>n </em>columns. If it does, it is called an <em>m </em>x<em> n </em>matrix. Consider the matrix <em>A </em>below<em>.</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A = \n\\begin{pmatrix}\na_{11} &amp; a_{12} &amp; a_{13} &amp; \\cdots &amp; a_{1n} \\\\\na_{21} &amp; a_{22} &amp; a_{23} &amp; \\cdots &amp; a_{2n} \\\\\na_{31} &amp; a_{32} &amp; a_{33} &amp; \\cdots &amp; a_{3n} \\\\\n\\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\na_{m1} &amp; a_{m2} &amp; a_{m3} &amp; \\cdots &amp; a_{mn}\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;VLPRZVRZVE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Each element <em>aij </em>in the matrix is a numerical value displayed in row <em>i </em>and column <em>j.</em></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uzDw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uzDw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 424w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 848w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 1272w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uzDw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png" width="367" height="376" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe4a283f-0c84-4712-8c20-192757f59f11_367x376.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:376,&quot;width&quot;:367,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uzDw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 424w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 848w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 1272w, https://substackcdn.com/image/fetch/$s_!uzDw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a283f-0c84-4712-8c20-192757f59f11_367x376.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h1>&#8203;Matrix addition</h1><p>To add a matrix to another, the matrices must be of the same dimensions, and the elements need to be added to the correct corresponding index.</p><p>Consider again the matrix <em>A</em>.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A = \n\\begin{pmatrix}\na_{11} &amp; a_{12} &amp; a_{13} &amp; \\cdots &amp; a_{1n} \\\\\na_{21} &amp; a_{22} &amp; a_{23} &amp; \\cdots &amp; a_{2n} \\\\\na_{31} &amp; a_{32} &amp; a_{33} &amp; \\cdots &amp; a_{3n} \\\\\n\\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\na_{m1} &amp; a_{m2} &amp; a_{m3} &amp; \\cdots &amp; a_{mn}\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;ALFGHASOBI&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The dimensions of matrix <em>A </em>are <em>m</em>x<em>n, </em>meaning that the matrix has <em>m </em>rows and <em>n </em>columns. Matrix <em>A, </em>therefore, can only be added to another matrix with <em>m </em>rows and <em>n </em>columns.</p><p>For example:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;B = \n\\begin{pmatrix}\nb_{11} &amp; b_{12} &amp; b_{13} &amp; \\cdots &amp; b_{1n} \\\\\nb_{21} &amp; b_{22} &amp; b_{23} &amp; \\cdots &amp; b_{2n} \\\\\nb_{31} &amp; b_{32} &amp; b_{33} &amp; \\cdots &amp; b_{3n} \\\\\n\\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\nb_{m1} &amp; b_{m2} &amp; b_{m3} &amp; \\cdots &amp; b_{mn}\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;KIIHSMDHIT&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The addition is simple, provided that the dimensions match. Add element <em>aij</em>&#8203; in <em>A</em> to the corresponding element <em>bij</em> in <em>B</em>.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A + B = \n\\begin{pmatrix}\na_{11} &amp; a_{12} &amp; \\cdots &amp; a_{1n} \\\\\na_{21} &amp; a_{22} &amp; \\cdots &amp; a_{2n} \\\\\n\\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\na_{m1} &amp; a_{m2} &amp; \\cdots &amp; a_{mn}\n\\end{pmatrix}\n+\n\\begin{pmatrix}\nb_{11} &amp; b_{12} &amp; \\cdots &amp; b_{1n} \\\\\nb_{21} &amp; b_{22} &amp; \\cdots &amp; b_{2n} \\\\\n\\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\nb_{m1} &amp; b_{m2} &amp; \\cdots &amp; b_{mn}\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;OLSNWGKUPL&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A + B = \n\\begin{pmatrix}\na_{11} + b_{11} &amp; a_{12} + b_{12} &amp; \\cdots &amp; a_{1n} + b_{1n} \\\\\na_{21} + b_{21} &amp; a_{22} + b_{22} &amp; \\cdots &amp; a_{2n} + b_{2n} \\\\\n\\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots \\\\\na_{m1} + b_{m1} &amp; a_{m2} + b_{m2} &amp; \\cdots &amp; a_{mn} + b_{mn}\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;ALAIFVUUQE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Below is an example of <em>D = A + B - C, </em>where all matrices are of the same dimension.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A = \n\\begin{pmatrix}\n1 &amp; 2 &amp; 3 \\\\\n4 &amp; 5 &amp; 6 \\\\\n7 &amp; 8 &amp; 9\n\\end{pmatrix},\n\\quad\nB = \n\\begin{pmatrix}\n9 &amp; 8 &amp; 7 \\\\\n6 &amp; 5 &amp; 4 \\\\\n3 &amp; 2 &amp; 1\n\\end{pmatrix},\n\\quad\nC = \n\\begin{pmatrix}\n2 &amp; 3 &amp; 1 \\\\\n5 &amp; 4 &amp; 6 \\\\\n8 &amp; 7 &amp; 9\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;PDJDGOLGME&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A + B - C = \n\\begin{pmatrix}\n1+9-2 &amp; 2+8-3 &amp; 3+7-1 \\\\\n4+6-5 &amp; 5+5-4 &amp; 6+4-6 \\\\\n7+3-8 &amp; 8+2-7 &amp; 9+1-9\n\\end{pmatrix} = D&quot;,&quot;id&quot;:&quot;PMVLHKVEWI&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;D = \n\\begin{pmatrix}\n8 &amp; 7 &amp; 9 \\\\\n5 &amp; 6 &amp; 4 \\\\\n2 &amp; 3 &amp; 1\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;ZVVILIRAZW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>If <em> i =  2 </em>and <em>j </em>= 3, then:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Dij = Aij + Bij = Cij&quot;,&quot;id&quot;:&quot;FOTRESAHHJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Which is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Dij = 6 + 4 - 6&quot;,&quot;id&quot;:&quot;QMPQUZVBXY&quot;}" data-component-name="LatexBlockToDOM"></div><p>That equates to:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Dij = 4&quot;,&quot;id&quot;:&quot;ERHSFLSZKR&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h1>Scalar multiplication of Matrix</h1><p>When multiplying a matrix by a scalar, the dimensions and indices need not be verified. Each element of the matrix is simply multiplied by the scalar.</p><p>For example:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\alpha \\cdot A = \\alpha \\cdot \n\\begin{pmatrix}\na_{11} &amp; a_{12} &amp; a_{13} \\\\\na_{21} &amp; a_{22} &amp; a_{23} \\\\\na_{31} &amp; a_{32} &amp; a_{33}\n\\end{pmatrix}\n=\n\\begin{pmatrix}\n\\alpha \\cdot a_{11} &amp; \\alpha \\cdot a_{12} &amp; \\alpha \\cdot a_{13} \\\\\n\\alpha \\cdot a_{21} &amp; \\alpha \\cdot a_{22} &amp; \\alpha \\cdot a_{23} \\\\\n\\alpha \\cdot a_{31} &amp; \\alpha \\cdot a_{32} &amp; \\alpha \\cdot a_{33}\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;FHNAJRAEFC&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where every element of the matrix <em>A</em> is multiplied by the scalar &#945;.</p><p></p><p>Using real numbers, this could be:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;3 \\cdot A = 3 \\cdot \n\\begin{pmatrix}\n1 &amp; 2 &amp; 3 \\\\\n4 &amp; 5 &amp; 6 \\\\\n7 &amp; 8 &amp; 9\n\\end{pmatrix}\n=\n\\begin{pmatrix}\n3 \\cdot 1 &amp; 3 \\cdot 2 &amp; 3 \\cdot 3 \\\\\n3 \\cdot 4 &amp; 3 \\cdot 5 &amp; 3 \\cdot 6 \\\\\n3 \\cdot 7 &amp; 3 \\cdot 8 &amp; 3 \\cdot 9\n\\end{pmatrix}\n=\n\\begin{pmatrix}\n3 &amp; 6 &amp; 9 \\\\\n12 &amp; 15 &amp; 18 \\\\\n21 &amp; 24 &amp; 27\n\\end{pmatrix}\n&quot;,&quot;id&quot;:&quot;JBCPIJRQDA&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where every element of the matrix <em>A </em>is multiplied by the scalar 3.</p><p></p><h1>Multiplication of Square Matrices</h1><p>When multiplying two matrices, the dimensions must align correctly. Specifically, if you have a matrix <em>A</em> of dimensions <em>m</em>&#215;<em>n</em>  and a matrix <em>B</em> of dimensions <em>p </em>&#215; <em>q</em>, multiplication is possible only if <em>n </em>= <em>p</em>. The resulting matrix <em>C</em>=<em>AB</em> will have dimensions <em>m &#215; q</em>.</p><p>The most straightforward scenario is multiplying two square matrices of the same dimensions <em>n </em>&#215; <em>n</em>. That is, both matrices have the same number of rows and columns.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Let \\ A\\ and\\ B\\ be\\ two\\ matrices:\\\n\n\nA = \\begin{pmatrix}\na_{11} &amp; a_{12} &amp; a_{13} \\\\\na_{21} &amp; a_{22} &amp; a_{23} \\\\\na_{31} &amp; a_{32} &amp; a_{33}\n\\end{pmatrix}, \\quad\nB = \\begin{pmatrix}\nb_{11} &amp; b_{12} &amp; b_{13} \\\\\nb_{21} &amp; b_{22} &amp; b_{23} \\\\\nb_{31} &amp; b_{32} &amp; b_{33}\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;IBCQOSCJAB&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;The\\ product\\ C = AB\\  is:\\\n\n\nC = \\begin{pmatrix}\nc_{11} &amp; c_{12} &amp; c_{13} \\\\\nc_{21} &amp; c_{22} &amp; c_{23} \\\\\nc_{31} &amp; c_{32} &amp; c_{33}\n\\end{pmatrix} \n= \\begin{pmatrix}\na_{11}b_{11} + a_{12}b_{21} + a_{13}b_{31} &amp; a_{11}b_{12} + a_{12}b_{22} + a_{13}b_{32} &amp; a_{11}b_{13} + a_{12}b_{23} + a_{13}b_{33} \\\\\na_{21}b_{11} + a_{22}b_{21} + a_{23}b_{31} &amp; a_{21}b_{12} + a_{22}b_{22} + a_{23}b_{32} &amp; a_{21}b_{13} + a_{22}b_{23} + a_{23}b_{33} \\\\\na_{31}b_{11} + a_{32}b_{21} + a_{33}b_{31} &amp; a_{31}b_{12} + a_{32}b_{22} + a_{33}b_{32} &amp; a_{31}b_{13} + a_{32}b_{23} + a_{33}b_{33}\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;HMCSWUNXDJ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Or to demonstrate with actual numbers:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Let\\ A\\ and\\ B\\ be\\ two\\ matrices:\\\nA = \\begin{pmatrix}\n1 &amp; 2 &amp; 3 \\\\\n4 &amp; 5 &amp; 6 \\\\\n7 &amp; 8 &amp; 9\n\\end{pmatrix}, \\quad\nB = \\begin{pmatrix}\n9 &amp; 8 &amp; 7 \\\\\n6 &amp; 5 &amp; 4 \\\\\n3 &amp; 2 &amp; 1\\end{pmatrix}&quot;,&quot;id&quot;:&quot;WOSOWJNAWE&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;The\\ product\\ C= AB\\ is:\nC = \\begin{pmatrix}\n(1 \\times 9 + 2 \\times 6 + 3 \\times 3) &amp; (1 \\times 8 + 2 \\times 5 + 3 \\times 2) &amp; (1 \\times 7 + 2 \\times 4 + 3 \\times 1) \\\\\n(4 \\times 9 + 5 \\times 6 + 6 \\times 3) &amp; (4 \\times 8 + 5 \\times 5 + 6 \\times 2) &amp; (4 \\times 7 + 5 \\times 4 + 6 \\times 1) \\\\\n(7 \\times 9 + 8 \\times 6 + 9 \\times 3) &amp; (7 \\times 8 + 8 \\times 5 + 9 \\times 2) &amp; (7 \\times 7 + 8 \\times 4 + 9 \\times 1)\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;IIMMBOICAW&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Simplifying\\ the\\ above:\\\n\nC = \\begin{pmatrix}\n30 &amp; 24 &amp; 18 \\\\\n84 &amp; 69 &amp; 54 \\\\\n138 &amp; 114 &amp; 90\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;LHJQGSPTUX&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Notice the pattern in finding each element c<em>ij</em> in the resulting matrix <em>C = AB</em>:  each element c<em>ij</em>&#8203; is calculated by taking the dot product of the <em>i</em>-th row of matrix <em>A</em> and the <em>j</em>-th column of matrix <em>B</em>. Specifically, this involves multiplying each element in the <em>i</em>-th row of <em>A</em> with the corresponding element in the <em>j</em>-th column of <em>B</em>, and then summing these products.</p><p>Here is a graphical illustration of this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MTnu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MTnu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 424w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 848w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 1272w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MTnu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png" width="833" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:833,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32396,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MTnu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 424w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 848w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 1272w, https://substackcdn.com/image/fetch/$s_!MTnu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d2cde5-5020-4ac7-87f7-f4938773960b_833x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xwg5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xwg5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 424w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 848w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 1272w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xwg5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png" width="833" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:833,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xwg5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 424w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 848w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 1272w, https://substackcdn.com/image/fetch/$s_!Xwg5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7411356b-ad95-4bf6-bc4a-01ab16027925_833x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eq68!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eq68!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 424w, https://substackcdn.com/image/fetch/$s_!eq68!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 848w, https://substackcdn.com/image/fetch/$s_!eq68!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 1272w, https://substackcdn.com/image/fetch/$s_!eq68!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eq68!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png" width="858" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:858,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32654,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eq68!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 424w, https://substackcdn.com/image/fetch/$s_!eq68!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 848w, https://substackcdn.com/image/fetch/$s_!eq68!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 1272w, https://substackcdn.com/image/fetch/$s_!eq68!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f96b65b-42a4-417c-a848-f70aae54db75_858x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These illustrations demonstrate the <strong>first row </strong>and the <strong>first column (C</strong><em><strong>ij):</strong></em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;c_{11} = 1 \\times 9 + 2 \\times 6 + 3 \\times 3 = 9 + 12 + 9 = 30\n&quot;,&quot;id&quot;:&quot;ERIUSSAHKB&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>If <em>A</em> is an <em>n</em>&#215;<em>m</em> matrix and <em>B</em> is an <em>m&#215;p</em> matrix, their matrix product <em>AB</em> will be an <em>n</em>&#215;<em>p</em>matrix. The way this product is calculated is as follows:</p><ul><li><p>Each entry in the resulting matrix <em>AB</em> is obtained by taking the corresponding row from matrix <em>A</em> and the corresponding column from matrix <em>B</em>.</p></li><li><p>Specifically, you multiply each of the <em>m</em> elements in a row of <em>A</em> with the corresponding <em>m</em> elements in a column of <em>B</em>, and then sum these products. This sum becomes an entry in the matrix <em>AB</em>.</p></li></ul><h3>Example:</h3><p>If <em>A</em> is 2&#215;3 (2 rows, 3 columns) and <em>B</em> is 3&#215;2 (3 rows, 2 columns), their product <em>AB</em> will be a 2&#215;2 matrix.</p><h3>Connection to Linear Transformations:</h3><p>When matrices represent linear transformations (functions that map vectors to other vectors in a linear fashion), the matrix product <em>AB</em> represents the composition of these transformations. This means applying the transformation represented by <em>B </em>first, followed by the transformation represented by <em>A</em>. The resulting transformation is described by the matrix <em>AB</em>.</p><p>In essence, matrix multiplication corresponds to performing one transformation after another.</p><p></p><h1>Non-Commutativity of Matrix Multiplication</h1><p>An important observation in matrix algebra is that, in general, matrix multiplication is <strong>not commutative</strong>. This means that for two matrices <em>A </em>and <em>B</em>, the product <em>A&#215;B</em> does not necessarily equal <em>B&#215;A</em>.</p><p>For example, consider matrices <em>A</em> and <em>B</em> as follows:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A = \\begin{pmatrix}\n3 &amp; 1 &amp; 2 \\\\\n-5 &amp; 4 &amp; 1 \\\\\n0 &amp; 3 &amp; -8\n\\end{pmatrix},\\\n\nB = \\begin{pmatrix}\n0 &amp; 5 &amp; -1 \\\\\n3 &amp; 2 &amp; -1 \\\\\n10 &amp; 0.5 &amp; 4\n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;NWPBQOGHMU&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>When <em>C=A&#215;B</em> element c23 in the resulting matrix is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;c_{23}^{(A \\times B)} = (-5 \\times -1) + (4 \\times -1) + (1 \\times 4) = 5&quot;,&quot;id&quot;:&quot;DTPBTZQUBD&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>However, if the multiplication is reversed, <em>C=B&#215;A</em>, the element becomes:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;c_{23}^{(B \\times A)} = (3 \\times 2) + (2 \\times 1) + (-1 \\times -8) = 16&quot;,&quot;id&quot;:&quot;TVTAVZMYAY&quot;}" data-component-name="LatexBlockToDOM"></div><p>So, clearly</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;c_{23}^{(A \\times B)}   \\neq\\   c_{23}^{(B \\times A)}&quot;,&quot;id&quot;:&quot;DKKJLNEGYE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Which means <em>A</em> x <em>B</em> &#8800; <em>B </em>= <em>A.</em></p><p>This demonstrates that matrix multiplication is <strong>not commutative</strong>. This contrasts with scalar multiplication, where the order of multiplication does not affect the result. This non-commutativity is a fundamental characteristic of matrix operations.</p>]]></content:encoded></item><item><title><![CDATA[Linear Combination]]></title><description><![CDATA[Span and Basis Vectors, and linear (in)dependence.]]></description><link>https://www.emdeh.com/p/linear-combination</link><guid isPermaLink="false">https://www.emdeh.com/p/linear-combination</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Mon, 19 Aug 2024 22:13:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4PW4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The &#8220;simple&#8221; definition of a <strong>linear combination </strong>is multiplying a scalar by a variable and adding those terms.</p><p>If <em>x, y, </em>and <em>z</em> are variables, and <em>a</em>1&#8203;, a2, <em>and a3 </em>are scalars, then the following equation will be a linear combination.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;v = a_1 x + a_2 y + a_3 z&quot;,&quot;id&quot;:&quot;VPNLZQVMAH&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>If the variables are <em>vectors</em>, then the linear combination of a scalar by a vector will be a new vector:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{v} = a_1 \\vec{x} + a_2 \\vec{y} + a_3 \\vec{z}&quot;,&quot;id&quot;:&quot;OYVEZACZQB&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The general notation of a vector by a scalar linear combination will be:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; \\sum\\frac{n}{1}\\ a_i \\vec{v}_i &quot;,&quot;id&quot;:&quot;SGWIKDMIHP&quot;}" data-component-name="LatexBlockToDOM"></div><h1>What is Span</h1><p>The <strong>span</strong> of a set of vectors is the set of all possible <strong>linear</strong> <strong>combinations</strong> of those vectors.</p><p>Mathematically, the span of the set of vectors is written as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Sp(\\vec{v}_1,\\vec{v}_2,...\\vec{v}_n)&quot;,&quot;id&quot;:&quot;YMKMZVGFKQ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>This represents all possible vectors that can be formed by taking linear combinations of the vectors with real scalars.</p><p>In the case of two vectors in 2-dimensional space, if the vectors are not linearly dependent (i.e., they do not lie on the same line), their span will be the entire 2-dimensional space, meaning they can reach any point in that space. However, if the vectors are linearly dependent (i.e., they lie on the same line), their span is limited to all vectors along that line.</p><p>For example, the following three vectors would span the entire <strong>R3</strong> space (the 3-dimensional vector space over the field of real numbers) because they are <strong>linearly independent</strong>. This means that no vector in the set can be expressed as a linear combination of the others, and together, they can represent any vector in <strong>R3</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{v}_1 = \\begin{pmatrix}1 \\\\0 \\\\0\\end{pmatrix},\n\n\\vec{v}_2 = \\begin{pmatrix}0 \\\\1 \\\\0\\end{pmatrix},\n\n\\vec{v}_3 = \\begin{pmatrix}0 \\\\0 \\\\1\\end{pmatrix}&quot;,&quot;id&quot;:&quot;NQLNXDIHSC&quot;}" data-component-name="LatexBlockToDOM"></div><h2>Span and 3-dimensional space</h2><p>The concept of <strong>span </strong>is more interesting in 3D space. Take two vectors that are not pointing in the same direction. <em><strong>What does it mean to take their span?</strong></em></p><p>In this case, the span of the two vectors is the set of all possible linear combinations of these vectors. Geometrically, this means that the span of these two vectors forms a plane in 3D space. Every vector (or point<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>) on this plane can be represented as a linear combination of the two original vectors.</p><p>Now, consider three vectors that are not all lying in the same plane. What happens when you take their span?</p><p>A linear combination of three vectors is essentially the same as it is in 2-dimensional space:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a \\vec{v} + b \\vec{w} + c\\vec{u}&quot;,&quot;id&quot;:&quot;XSJRIBYMFW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>In 3D space, the span of three linearly independent vectors (that do not lie in the same plane) is the entire 3-dimensional space. This means that any vector/point in the space can be expressed as a linear combination of the three vectors.</p><p>So, the span of the vectors <em>v, w, </em>and <em>u</em> is the set of all possible vectors you can create by varying the scalars <em>a, b, </em>and <em>c</em> in the linear combination above. When these three vectors are linearly independent, their span covers all of 3D space.</p><h1><strong>Linear dependence</strong></h1><p>When a set of vectors is said to be <strong>linearly</strong> <strong>dependent</strong>, it means that at least one of the vectors in the set can be expressed as a <strong>linear</strong> <strong>combination</strong> of the others. In other words, some vectors in the set are redundant because they <strong>do not add any new direction (or span)</strong> to the vector space that the other vectors already cover.</p><div class="pullquote"><p>Linearly dependent vectors do not contribute to increasing the span of the vector space.</p></div><p>In <em>n</em>-dimensional space, if a set of vectors is linearly dependent, the span of these vectors does not cover any additional directions beyond what is already covered by a subset of these vectors. Consequently, t<strong>he set does not form a basis for the vector space</strong>, as a basis requires all vectors to be linearly independent, ensuring that they span the entire space without redundancy.</p><p>For example, take the following two vectors:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{v}_2 = \\begin{pmatrix}2 \\\\2 \\\\2\\end{pmatrix}&quot;,&quot;id&quot;:&quot;HCIQGQWEUI&quot;}" data-component-name="LatexBlockToDOM"></div><p>and:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n\\vec{v}_3 = \\begin{pmatrix}8 \\\\8 \\\\8\\end{pmatrix}&quot;,&quot;id&quot;:&quot;UKVSBNZYTC&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>These represent a linearly <strong>dependent</strong> set. Notice that each component of <em>v2 </em>is precisely one-fourth of the corresponding elements of <em>v3.</em></p><p>Specifically:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{v}_3 = 4 \\times \\vec{v}_2&quot;,&quot;id&quot;:&quot;AJWAZOPIII&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>This means <em>v3 </em>is simply a scaled version of <em>v2. </em>They are not independent because <em>v3</em> can be written as a scalar multiple of <em>v2</em>. In other words, <em>v2 </em>and <em>v3 </em>lie along the same line in 3D space but at different magnitudes.</p><p>Visualising this concept in 3-dimensional space can be challenging. Consider a graphical representation with just two components in each vector for simplicity. As shown, the span of one vector is entirely encompassed by the other.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4PW4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4PW4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 424w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 848w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 1272w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4PW4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png" width="906" height="891" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:891,&quot;width&quot;:906,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56887,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4PW4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 424w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 848w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 1272w, https://substackcdn.com/image/fetch/$s_!4PW4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafab105b-f6d2-4930-8c77-b4d32b7cdb21_906x891.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>3Blue1Brown has great visualisations in his videos that better demonstrate exactly how this limits access to further span in a 3-dimensional vector space.</p></blockquote><div id="youtube2-RsKJNDTb8nw" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;RsKJNDTb8nw&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/RsKJNDTb8nw?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h1><strong>Linear independence</strong></h1><p>When each vector in a set of vectors <strong>can not</strong> be defined as a linear combination of the other vectors, they are said to be <strong>linearly independent</strong>.</p><p>That is, for all values of <em>a:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{w} \\neq a\\vec{v}&quot;,&quot;id&quot;:&quot;GHVXAWHLIA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Or for all values of <em>a </em>and <em>b:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{u}  \\neq a\\vec{v} + b\\vec{w}&quot;,&quot;id&quot;:&quot;SRCLVTKRFS&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>For example:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n\\vec{v}_1 = \\begin{pmatrix}1 \\\\2 \\\\3\\end{pmatrix} ,\\ \\vec{v}_3 = \\begin{pmatrix}8 \\\\8 \\\\8\\end{pmatrix}&quot;,&quot;id&quot;:&quot;CLQPAXMAAR&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>These vectors are linearly independent.</p><p>To check if the vectors are linearly independent, there should be no scalar, <em>k, </em>such that:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;v \n3\n&#8203;\n \n&#8203;\n \\neq k&#8901; \nv \n1\n&#8203;\n \n&#8203;\n&quot;,&quot;id&quot;:&quot;OKPNCDLZBN&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>In other words, each component of <em>v3 </em>can not be equal to the corresponding components <em>v1 </em>multiplied by <em>k.</em></p><p>For:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{v}_1 = \\begin{pmatrix}1 \\\\2 \\\\3\\end{pmatrix} ,\\ \\vec{v}_3 = \\begin{pmatrix}8 \\\\8 \\\\8\\end{pmatrix}&quot;,&quot;id&quot;:&quot;KNUWYSBFSI&quot;}" data-component-name="LatexBlockToDOM"></div><p>This would require:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;k&#8901;1=8 ,\\ k&#8901;2=8 ,\\ k&#8901;3=8&quot;,&quot;id&quot;:&quot;GKKMAUBSBA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>To solve for <em>k</em> in the components:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{c}\n\\text{From the first component:} \\quad k = \\frac{8}{1} = 8 \\\\\n\\text{From the second component:} \\quad k = \\frac{8}{2} = 4 \\\\\n\\text{From the third component:} \\quad k = \\frac{8}{3} \\approx 2.67\n\\end{array}&quot;,&quot;id&quot;:&quot;YFKGFGLIDE&quot;}" data-component-name="LatexBlockToDOM"></div><p>The vectors are linearly independent since no single scalar <em>k</em> satisfies the equation for all components.</p><p>Again, this is challenging to represent on a 3-dimensional plane (see the video above!), but taking the first two components illustrates linearly independent vectors.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bO_x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bO_x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 424w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 848w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 1272w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bO_x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png" width="903" height="902" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:902,&quot;width&quot;:903,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56597,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bO_x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 424w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 848w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 1272w, https://substackcdn.com/image/fetch/$s_!bO_x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d5e1ff3-5b4a-4e33-9a8a-6a5aca66961a_903x902.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>A note on basis vectors</h2><p>The technical definition of a <em><strong>basis</strong></em><strong> </strong>of a vector space is a set of <em><strong>linearly</strong></em><strong> </strong><em><strong>independent</strong></em><strong> </strong>vectors that <em><strong>span</strong></em><strong> </strong>the full space.</p><ul><li><p><strong>Linearly Independent</strong>: No vector in the set can be written as a linear combination of the others. This ensures that all vectors in the basis contribute uniquely to spanning the space.</p></li><li><p><strong>Span</strong>: The set of vectors can be combined (through linear combinations) to form every possible vector in the space.</p></li></ul><p>If you have a basis for a vector space, you can represent any vector in that space as a unique linear combination of the <strong>basis</strong> <strong>vectors</strong>.</p><p><em><strong>i&#770;</strong></em> and <em><strong>j&#770; </strong></em>are the &#8220;basis vectors&#8221; of the <em>xy </em>coordinate system.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{\\imath} = \\begin{pmatrix} 1 \\\\ 0 \\end{pmatrix}, \\quad \\hat{\\jmath} = \\begin{pmatrix} 0 \\\\ 1 \\end{pmatrix}&quot;,&quot;id&quot;:&quot;PCEBZWDLYG&quot;}" data-component-name="LatexBlockToDOM"></div><p>In the <em>xy </em>coordinate system,</p><ul><li><p><em><strong>i&#770;</strong> </em>represents the unit vector in the direction of the <em>x</em>-axis. </p></li><li><p><em><strong>j&#770;</strong> </em>represents the unit vector in the direction of the<em> y-</em>axis</p></li></ul><div class="pullquote"><p><em>By taking linear combinations of these basis vectors, every possible 2-dimensional vector can be expressed.</em></p></div><p>Whenever vectors are described numerically, it implicitly assumes a choice of basis vectors, typically <em><strong>i&#770;</strong></em> and <em><strong>j&#770;</strong></em> in 2-dimensional Cartesian coordinates. Changing the basis vectors changes the representation of all vectors in that space, though the vectors themselves remain unchanged.</p><h1>A system of Linear Equations</h1><p>A linear combination of vectors by scalars is crucial in solving systems of linear equations. For instance, suppose a vector needs to be represented as a linear combination of two other vectors.</p><p>Consider the following vector:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n\\vec{v}= \\begin{pmatrix}-13 \\\\2\\end{pmatrix}&quot;,&quot;id&quot;:&quot;PFQGPSOKCL&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Which needs to be the linear combination of:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x}= \\begin{pmatrix}-14 \\\\2\\end{pmatrix}, \\quad \\vec{y} = \\begin{pmatrix} 5 \\\\ -1 \\end{pmatrix}&quot;,&quot;id&quot;:&quot;WEMCKOXZKX&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>In this situation, the equation solves for scalars <em>a </em>and <em>b, </em>where <em>a </em>and <em>b </em>represent the coefficients of <em>x </em>and <em>y, </em>respectively:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a\\vec{x} + b\\vec\n{y} = \\vec{v}&quot;,&quot;id&quot;:&quot;JYAKHPCFKG&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>First, multiply each vector by its corresponding scalar:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\na \\begin{pmatrix}-14 \\\\2\\end{pmatrix} + b \\begin{pmatrix}5 \\\\-1\\end{pmatrix} = \\begin{pmatrix}-13 \\\\2\\end{pmatrix}&quot;,&quot;id&quot;:&quot;LLDXHFBAYE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Which is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n \\begin{pmatrix}(-14)a \\\\2a\\end{pmatrix} + \\begin{pmatrix}5b \\\\(-1)b\\end{pmatrix} = \\begin{pmatrix}-13 \\\\2\\end{pmatrix}&quot;,&quot;id&quot;:&quot;WNDGURVSLE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The above results gives two separate equations:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{cases} \n\\begin{aligned}\n-14a + 5b &amp;= -13 \\\\\n2a - b &amp;= 2 \n\\end{aligned}\n\\end{cases}&quot;,&quot;id&quot;:&quot;GYUQLQCVOA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>These equations form a s<strong>ystem of two equations with two unknowns.</strong></p><p>There are three theoretical methods to solve the equations.</p><h2>Substitution Method</h2><p>To solve a system of equations by substitution, first, isolate a variable from one of the equations and substitute it into the other. This reduces the system of equations to a single equation with a single unknown.</p><p><strong>Equation 1</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14a + 5b = -13&quot;,&quot;id&quot;:&quot;NIXPJXACJK&quot;}" data-component-name="LatexBlockToDOM"></div><p><strong>Equation 2</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2a - b = 2&quot;,&quot;id&quot;:&quot;WPJVPSDKCU&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Step 1 - Solve one equation for one variable</strong></h4><p>Starting with <strong>Equation 2</strong> for <em>b </em>in terms of <em>a:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2a - b = 2&quot;,&quot;id&quot;:&quot;XOHEGUFNKT&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>To isolate <em>b, </em>add <em>b </em>to both sides and subtract 2 from both sides:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b  = 2a - 2&quot;,&quot;id&quot;:&quot;QVVFAURNSW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Now <em>b </em>is expressed in terms of <em>a.</em></p><p></p><h4><strong>Step 2 - Substitute the expression into the other equation</strong></h4><p>Substitute the expression for <em>b </em>from <strong>Equation 2 </strong>into <strong>Equation 1:</strong></p><p>So Equation 1 goes from:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14a + 5b = -13&quot;,&quot;id&quot;:&quot;DXAMARMOKM&quot;}" data-component-name="LatexBlockToDOM"></div><p>to:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14a + 5(2a - 2) = -13&quot;,&quot;id&quot;:&quot;TGVIRDPMQK&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Step 3 - Simplify and solve for </strong><em><strong>a</strong></em></h4><p>Expand the equation:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14a + 10a - 10 = -13&quot;,&quot;id&quot;:&quot;QTEESVKGPC&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Combine like terms:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-4a - 10 = -13&quot;,&quot;id&quot;:&quot;ZCFUSVAKKN&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Isolate the term with <em>a </em>by adding 10 to both sides<em>:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-4a - 10 +10 = -13 + 10&quot;,&quot;id&quot;:&quot;KJEPEBQIOU&quot;}" data-component-name="LatexBlockToDOM"></div><p>becomes:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-4a = -3&quot;,&quot;id&quot;:&quot;KCKFYIFBTO&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Divide both sides by -4 to solve for <em>a:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a = \\frac{-3}{-4} = 0.75&quot;,&quot;id&quot;:&quot;KXDOGOAXGH&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Step 4 - Substitute back to find </strong><em><strong>b</strong></em></h4><p>Now that <em>a = 0.75, </em>substitute this value back into the expression for <em>b:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b = 2a -2&quot;,&quot;id&quot;:&quot;BVOUAOZKGD&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Substitute <em>a = 0.75:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b = 2(0.75) - 2&quot;,&quot;id&quot;:&quot;QAEHWMUKPS&quot;}" data-component-name="LatexBlockToDOM"></div><p>Which equals:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b= 1.5 - 2&quot;,&quot;id&quot;:&quot;WUQZDEKJPK&quot;}" data-component-name="LatexBlockToDOM"></div><p>which is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b= -0.5&quot;,&quot;id&quot;:&quot;QNBLWWRCPM&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Step 5 - Verify the solution</strong></h4><p>To ensure the solution is correct, substitute <em>a = -0.75 </em>and <em>b = -0.5 </em>back into the original equations.</p><h5><strong>Check Equation 1</strong></h5><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14a + 5b = -13&quot;,&quot;id&quot;:&quot;GAONZBULCX&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substitute <em>a </em>for <em>0.75 </em>and <em>b </em>for -0.5:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-14(0.75) + 5(-0.5)&quot;,&quot;id&quot;:&quot;CBCRPXOQXI&quot;}" data-component-name="LatexBlockToDOM"></div><p>this equates to :</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; -10.5 - 2.5 = -13&quot;,&quot;id&quot;:&quot;NGMSSJTZRG&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h5><strong>Check Equation 2</strong></h5><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2a - b = 2&quot;,&quot;id&quot;:&quot;BYFGJXCIXT&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substitute <em>a </em>for <em>0.75 </em>and <em>b </em>for -0.5: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2(0.75) - (-0.5)&quot;,&quot;id&quot;:&quot;XMXZIXSKEY&quot;}" data-component-name="LatexBlockToDOM"></div><p>and equates to:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;1.5+0.5=2&quot;,&quot;id&quot;:&quot;ZIDBSSTUFM&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Final answer:</strong></h4><p><strong>The solution to the system of equations is:</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a = 0.75 ,\\ b = -0.5&quot;,&quot;id&quot;:&quot;QTSHFWFEDJ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>This solution satisfies both equations, confirming the calculations are correct.</p><h2>Elimination Method</h2><p>In this method, one of the variables is eliminated by enforcing the same absolute value for one of the coefficients (scalars) in the two equations. </p><p>The equations again are:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{cases} \n\\begin{aligned}\n-14a + 5b &amp;= -13 \\\\\n2a - b &amp;= 2 \n\\end{aligned}\n\\end{cases}&quot;,&quot;id&quot;:&quot;VCCVPFNYBW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>If Equation 2 is multiplied by 5, the equations become:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{cases} \n\\begin{aligned}\n-14a + 5b &amp;= -13 \\\\\n(2*5)a - 5b &amp;= 2*5\n\\end{aligned}\n\\end{cases}&quot;,&quot;id&quot;:&quot;GJDHUKCKIH&quot;}" data-component-name="LatexBlockToDOM"></div><p>simplified to:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{cases} \n\\begin{aligned}\n-14a + 5b &amp;= -13 \\\\\n10a - 5b &amp;= 10\n\\end{aligned}\n\\end{cases}&quot;,&quot;id&quot;:&quot;AMACQYVJIC&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4>Step 1: Add the Equations</h4><p>Now, add the two equations to eliminate <em>b </em>and obtain a single equation with a single unknown:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(-14a + 5b) + (10a - 5b) = -13 + 10&quot;,&quot;id&quot;:&quot;FGPTAPZYSU&quot;}" data-component-name="LatexBlockToDOM"></div><p>This becomes:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;14a+10a=&#8722;3&quot;,&quot;id&quot;:&quot;TUMUZLINZD&quot;}" data-component-name="LatexBlockToDOM"></div><p>Combine like terms:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-4a = -3&quot;,&quot;id&quot;:&quot;VKCMIZYGKN&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4>Step 2: Solve for <em>a</em></h4><p>To solve for <em>a, </em>isolate <em>a </em>by dividing both sides by -4:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; \\frac{-3}{-4} = \\frac{3}{-4}&quot;,&quot;id&quot;:&quot;SZBJBRIMLH&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a = \\frac{3}{4}&quot;,&quot;id&quot;:&quot;JBMZIKZIJR&quot;}" data-component-name="LatexBlockToDOM"></div><p>Or:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a = 0.75&quot;,&quot;id&quot;:&quot;HLFMGOEVNZ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4>Step 3: Substitute back to Find <em>b</em></h4><p>Now that <em>a = 0.75, </em>substitute this value back into the expression for <em>b:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2a - b = 2&quot;,&quot;id&quot;:&quot;RPXNGFEQFM&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substitute <em>a = 0.75:</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2(0.75) - b = 2&quot;,&quot;id&quot;:&quot;TZARBRFYXV&quot;}" data-component-name="LatexBlockToDOM"></div><p>Which equals:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;1.5 - b = 2&quot;,&quot;id&quot;:&quot;RWYPVQFKIK&quot;}" data-component-name="LatexBlockToDOM"></div><p>Subtract 1.5 from both sides:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;-b = 0.5&quot;,&quot;id&quot;:&quot;EGVJZZBKQO&quot;}" data-component-name="LatexBlockToDOM"></div><p>Multiply both sides by -1:<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b = -0.5&quot;,&quot;id&quot;:&quot;IRNNQRYFUM&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4><strong>Final answer</strong></h4><p>This means scalars <em>a = 0.75 </em>and <em>b = -0.5 </em>represent the vector:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; \\vec{v} = \\begin{pmatrix}-13 \\\\2\\end{pmatrix}&quot;,&quot;id&quot;:&quot;JXZGDDEFQO&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>as a linear combination of vectors <em>x </em>and <em>y</em>.</p><p>Substituting the vectors</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\n \\begin{pmatrix}-13 \\\\2\\end{pmatrix} = a\\ \\cdot \\begin{pmatrix}-14 \\\\2\\end{pmatrix} + b \\cdot \\begin{pmatrix}5 \\\\-1\\end{pmatrix}&quot;,&quot;id&quot;:&quot;HPJDAMLAPO&quot;}" data-component-name="LatexBlockToDOM"></div><p>is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{pmatrix}-13\\\\2\\end{pmatrix} = 0.75 \\cdot \\begin{pmatrix}-14 \\\\2\\end{pmatrix} + (-0.5) \\cdot\\begin{pmatrix}5 \\\\-1\\end{pmatrix}&quot;,&quot;id&quot;:&quot;ZPKLFSKIZC&quot;}" data-component-name="LatexBlockToDOM"></div><p>is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; \\begin{pmatrix}-13 \\\\2\\end{pmatrix} = \\begin{pmatrix}-10.5\\\\1.5\\end{pmatrix}  + \\begin{pmatrix}-2.5 \\\\0.5\\end{pmatrix}&quot;,&quot;id&quot;:&quot;TBKYIWVLCC&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h1>Graphical  Method</h1><p>When using the graphical method to solve a system of linear equations by drawing the lines on a plane,  calculate the following:</p><h4><strong>Step 1: Slope-Intercept Form of Each Equation:</strong></h4><p>The general form of a linear equation is <em>y = mx + c</em>, where:</p><ul><li><p><em>m</em> is the slope of the line.</p></li><li><p><em>c </em>is the <em>y</em>-intercept (when <em>x </em>= 0<em>)</em>.</p></li></ul><p>For each equation, rearrange it into the slope-intercept form <em>y = mx + c.</em></p><p>Given the system of equations:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{cases} \n\\begin{aligned}\n-14a + 5b &amp;= -13 \\\\\n2a - b &amp;= 2 \n\\end{aligned}\n\\end{cases}&quot;,&quot;id&quot;:&quot;KGVKPTTXKH&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p><strong>Equation1:</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;&#8722;14a+5b=&#8722;13&quot;,&quot;id&quot;:&quot;PUVPPPPBIW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>To solve for <em>b</em>, isolate <em>b </em>on one side:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;5b=14a&#8722;13&quot;,&quot;id&quot;:&quot;DBPHDBDCYL&quot;}" data-component-name="LatexBlockToDOM"></div><p>Now, divide by 5 to solve for <em>b</em>:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b =  \\frac{14}{5}a - \\frac{13}{5}&quot;,&quot;id&quot;:&quot;GYTFKJMXVZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is the slope-intercept form of the equation in terms of <em>y = mx +c.</em></p><p></p><p><strong>Equation 2:</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2a - b = 2&quot;,&quot;id&quot;:&quot;KANMLHOOIJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>To solve for <em>b</em>, isolate <em>b </em>on one side:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;- b = -2a + 2&quot;,&quot;id&quot;:&quot;AMHZKRGUHG&quot;}" data-component-name="LatexBlockToDOM"></div><p>Now multiply the entire equation by -1 to solve for b:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b=2a&#8722;2&quot;,&quot;id&quot;:&quot;QDUUGMOQXZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is the slope-intercept form of the equation in terms of <em>y = mx +c.</em></p><h4></h4><h4>Step 2: <strong>Plot the Lines:</strong></h4><p><strong>Equation 1<br></strong>Start by plotting the <em>y-</em>intercept at:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(0, \\frac{13}{5})&quot;,&quot;id&quot;:&quot;CUYTZKSIGC&quot;}" data-component-name="LatexBlockToDOM"></div><p>Use the slope to find another point. For every five units moved to the right, increase <em>b </em>by 13 units.</p><p><strong>Equation 2</strong></p><p>Start by plotting the <em>y</em>-intercept at:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(0,2)&quot;,&quot;id&quot;:&quot;BFUSNYWHIP&quot;}" data-component-name="LatexBlockToDOM"></div><p>Use the slope 2 to find another point. For each 1 unit moved to the right, <em>b </em>increases by two units.</p><h4>Step 4: <strong>Find the Intersection Point:</strong></h4><p>The point where the two lines intersect is the solution of the system of equations.</p><p>This point corresponds to the values of <em>x </em>and <em>y</em> that satisfy both equations simultaneously.</p><p>In this case the point of intersection (the solution to the system of equations) is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(\\frac{3}{4}, -\\frac{1}{2})&quot;,&quot;id&quot;:&quot;XENLKRXHVB&quot;}" data-component-name="LatexBlockToDOM"></div><p>or:</p><ul><li><p><em>a = 0.75</em></p></li><li><p><em>b = -0.5</em></p></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><h4>Vectors vs. Points</h4><p>When thinking about individual vectors, conceptualise them as arrows. When dealing with a collection of vectors, it is easier to think of them as points in an <em>n-</em>dimensional vector space.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>The goal is to solve for <em>b</em>. To do this, you need to isolate <em>b</em>. Since the equation has <em>&#8722;b </em>(negative <em>b</em>), multiplying both sides of the equation by &#8722;1 will make <em>b </em>positive.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Vectors in Linear Algebra]]></title><description><![CDATA[Magnitude, Direction, Transpose, and Operations in Field.]]></description><link>https://www.emdeh.com/p/vectors-in-linear-algebra</link><guid isPermaLink="false">https://www.emdeh.com/p/vectors-in-linear-algebra</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Mon, 19 Aug 2024 05:25:11 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c80b170a-97e3-43dc-bcf0-048d4eb5b48f_1024x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>What&#8217;s a vector</h1><p>Simply put, a vector is a list of ordered numbers. Each <strong>element</strong> in a vector is also called a <strong>component</strong> or <strong>coordinate</strong>. </p><p>In the example below, a vector (<em>x</em>) is in the <em>field of Real Numbers</em> with <em>n-</em>dimensions.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;ONFTZMUDNB&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The vector has infinite elements, as denoted by the ellipsis.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} x_1 \\\\ x_2 \\\\ x_3 \\\\ \\vdots \\end{pmatrix} &quot;,&quot;id&quot;:&quot;LREFZQWUUJ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The following vector within a 2-dimensional field of Real Numbers has two elements.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} 4 \\\\ 2 \\end{pmatrix} \\in \\mathbb{R}^2&quot;,&quot;id&quot;:&quot;BTQMMCZTVJ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>This essentially represents a line on a 2-dimensional plane.</p><p>The elements of a vector give instructions on how to get from the origin of a coordinate grid (e.g., <em>x = </em>0, <em>y = </em>0). In other words, where the tail of the vector begins, to its tip.</p><p>The first number is how far to move to the right or left along the <em>x</em>-axis, while the second is how far to move up or down the <em>y-axis</em>.</p><p>In the vector above, the first element, 4, represents the movement along an <em>x-</em>axis. The second element, 2, represents the movement along a <em>y-</em>axis.</p><p>Visually, this could look like the following:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2OkW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2OkW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 424w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 848w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 1272w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2OkW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png" width="841" height="831" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:831,&quot;width&quot;:841,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35555,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2OkW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 424w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 848w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 1272w, https://substackcdn.com/image/fetch/$s_!2OkW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f8320-9737-46b7-aed5-deb36fd3a36c_841x831.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Starting from <em>B, </em>there are four movements to the right and then two movements vertically to reach <em>A.</em></p><p>Mathematically, this would appear as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(-2, -1) + (2, 1) = \\vec{x} = \\begin{pmatrix} 4 \\\\ 2 \\end{pmatrix}&quot;,&quot;id&quot;:&quot;INOZYZPPGP&quot;}" data-component-name="LatexBlockToDOM"></div><h1>Vector transpose</h1><p>Vectors can be <strong>column vectors </strong>or <strong>row vectors. </strong>In Linear Algebra, a <strong>transpose </strong>is when a column vector takes the shape of a row vector or vice versa. The mathematical notation for a transpose is <em>T.</em></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; \\begin{pmatrix} a_1 \\\\ a_2  \\\\ \\vdots \\\\a_n\\end{pmatrix}^T = \\begin{pmatrix} a_1 &amp; a_2 &amp; \\cdots\\ a_n\\end{pmatrix}&quot;,&quot;id&quot;:&quot;LDYYCFWODL&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>In other words:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x}^T = \\vec{y}&quot;,&quot;id&quot;:&quot;JLUORAQWPL&quot;}" data-component-name="LatexBlockToDOM"></div><h2>Magnitude</h2><p>Each vector holds a <em><strong>magnitude</strong></em>.</p><p>The symbol used for <strong>magnitude </strong>is || ||.</p><p>The Pythagorean Theorem calculates the magnitude of a <strong>2D </strong>vector.</p><p>For example, take the vector:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} 4 \\\\ 2 \\end{pmatrix}&quot;,&quot;id&quot;:&quot;PZJTIQZEDZ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The magnitude would be calculated as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\| \\vec{x} \\|= \\sqrt{4^2 + 2^2}&quot;,&quot;id&quot;:&quot;EEFMKJKNAF&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Where 4 is the horizontal element (e.g., four movements along the <em>x-</em>axis) and 2 is the vertical element (e.g., two movements along the <em>y</em>-axis).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ey9R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ey9R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 424w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 848w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 1272w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ey9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png" width="1035" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1035,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37089,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ey9R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 424w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 848w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 1272w, https://substackcdn.com/image/fetch/$s_!ey9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c782cda-b8e9-4425-9794-887a20b7d8d1_1035x1027.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Direction</h2><p>Therefore, the angle created by moving along the two axes gives the <em><strong>direction</strong></em> of the vector. Looking at the vector visually, the angle is denoted by <em>&#952;.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1SeQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1SeQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 424w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 848w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 1272w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1SeQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png" width="1058" height="1043" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1043,&quot;width&quot;:1058,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53940,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1SeQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 424w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 848w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 1272w, https://substackcdn.com/image/fetch/$s_!1SeQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7b88b7-ca5a-4a91-a969-465514e3ee10_1058x1043.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Trigonometry is used to calculate the angle:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\theta = \\tan^{-1}\\frac{y}{x}&quot;,&quot;id&quot;:&quot;HCBEEPHUTO&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where <em><strong>y </strong>is </em>the short side of the triangle and <em><strong>x </strong></em><strong>is </strong>the long side.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0ALu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0ALu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 424w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 848w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 1272w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0ALu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png" width="1102" height="664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:664,&quot;width&quot;:1102,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0ALu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 424w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 848w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 1272w, https://substackcdn.com/image/fetch/$s_!0ALu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff0d0980-a798-478d-ab61-0dadad48a899_1102x664.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In this case:</p><p></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\theta = \\tan^{-1}\\frac{2}{4}= 26.56505^\\circ\\&quot;,&quot;id&quot;:&quot;DRMMAFQVJO&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p></p><div><hr></div><h1>Operations in the field</h1><h2>Vector addition</h2><p>The mathematical definition of vector addition in the Real Numbers field is to add the elements entry by entry.</p><p>Take two vectors, for example:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} a_1 \\\\ a_2 \\\\ a_3 \\\\ \\vdots \\\\ a_n \\end{pmatrix}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;SSWBGLHFLZ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{y} = \\begin{pmatrix} b_1 \\\\ b_2 \\\\ b_3 \\\\ \\vdots \\\\ b_n \\end{pmatrix}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;TSIUTCSBJS&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The result of summing these two vectors will also be in the Real Numbers field.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} + \\vec{y} = \\begin{pmatrix} a_1 + b_1 \\\\ a_2 + b_2  \\\\ a_3 + b_3 \\\\ \\vdots \\\\ a_n + b_n \\end{pmatrix}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;DROKIMZQQE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p></p><p>For example, take these two vectors:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} 5 \\\\ 2 \\\\ \\end{pmatrix} &quot;,&quot;id&quot;:&quot;LEWXHCSMBG&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{y} = \\begin{pmatrix} -4 \\\\ -1 \\\\ \\end{pmatrix} &quot;,&quot;id&quot;:&quot;FZPFTVWDBG&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The <strong>sum of the first element:</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a_1 + b_1&quot;,&quot;id&quot;:&quot;RVRDDSCKXI&quot;}" data-component-name="LatexBlockToDOM"></div><p>is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;5+ -4 = 1&quot;,&quot;id&quot;:&quot;PDFEAJGDSE&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>The <strong>sum of the second element:</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a_2 + b_2&quot;,&quot;id&quot;:&quot;MOLWNDKNSE&quot;}" data-component-name="LatexBlockToDOM"></div><p>is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2 + -1 = 1&quot;,&quot;id&quot;:&quot;QJLMGLPPSD&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Therefore:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} + \\vec{y} = \\begin{pmatrix} 1 \\\\ 1 \\\\ \\end{pmatrix} &quot;,&quot;id&quot;:&quot;DFVNAQCQWA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Visually, this is the same as moving the tail of the second vector to sit at the tip of the first.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OpHo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OpHo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 424w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 848w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 1272w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OpHo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png" width="913" height="843" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:843,&quot;width&quot;:913,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39583,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OpHo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 424w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 848w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 1272w, https://substackcdn.com/image/fetch/$s_!OpHo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5291069-7fe3-4f9b-b0a4-bf5d6dca2468_913x843.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2OnJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2OnJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 424w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 848w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 1272w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2OnJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png" width="843" height="843" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:843,&quot;width&quot;:843,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39157,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2OnJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 424w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 848w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 1272w, https://substackcdn.com/image/fetch/$s_!2OnJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15966b92-4528-41d8-a28e-93e939fbf20b_843x843.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Then drawing a new vector from the origin of the first vector to the tip of the second vector.</p><p>The resulting <em>third vector</em> is said to be the sum of the original two.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GpYn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GpYn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 424w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 848w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 1272w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GpYn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png" width="845" height="841" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:841,&quot;width&quot;:845,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40316,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GpYn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 424w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 848w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 1272w, https://substackcdn.com/image/fetch/$s_!GpYn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f5420ef-38ab-4de5-a652-a4333ec37509_845x841.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="pullquote"><p>Vector addition is the only time a vector will stray from the origin (<em>x = </em>0, <em>y = </em>0).</p></div><h3>How does this look numerically?</h3><p>In the example above, it is the same as:</p><ul><li><p>Five steps to the right (5)</p></li><li><p>Two steps up (2)</p></li><li><p>Four steps to the left (-4)</p></li><li><p>One step down (-1)</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ln8x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ln8x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 424w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 848w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ln8x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png" width="936" height="936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:936,&quot;width&quot;:936,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45813,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ln8x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 424w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 848w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln8x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c64af48-d887-4481-acd6-c6c134e0557a_936x936.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Or :</p><ul><li><p>5 + (-4) = 1</p></li><li><p>2 + (-1) = 1</p></li></ul><h3><em><strong>Why is this a good definition of addition?</strong></em></h3><p>Think of each vector as a movement in space; a step with a distance and direction from some point of origin. Taking a step along the first vector and then a step along the second, the overall movement would be the same as the sum of the vectors, as described above.</p><p>It is the same as visualising movement on a one-dimensional number line. Taking two steps to the right and six further steps reaches position 8, just as if you were taking all eight steps simultaneously.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mrO5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mrO5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 424w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 848w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 1272w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mrO5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png" width="1081" height="349" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:349,&quot;width&quot;:1081,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mrO5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 424w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 848w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 1272w, https://substackcdn.com/image/fetch/$s_!mrO5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc54e9550-0ece-420c-b003-cc5fff76d4c7_1081x349.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Scalar by vector multiplication</h2><p>A scalar by vector multiplication is also defined by multiplying the vector elements entry by entry</p><p>If <em>&#945;</em>&#8712;R (that is, <em>&#945;</em> is a number in the field of Real Numbers), and the vector is: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{x} = \\begin{pmatrix} a_1 \\\\ a_2 \\\\ a_3 \\\\ \\vdots \\\\ a_n \\end{pmatrix}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;TTIEXYYPNT&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Then, each vector element is multiplied by the scalar (<em>&#945;</em>).</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\vec{y} = \\alpha\\vec{x} = \\begin{pmatrix} \\alpha a_1 \\\\ \\alpha a_2 \\\\ \\alpha a_3 \\\\ \\vdots \\\\ \\alpha a_n \\end{pmatrix}  \\in \\mathbb{R}^n&quot;,&quot;id&quot;:&quot;MAYDVVDLSW&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Visually, scalar by vector multiplication extends the vector&#8217;s direction and increases or decreases the magnitude. Therefore, if the scalar is a fraction, the vector is reduced proportionally to that fraction.</p><p>Using a scalar of a negative number would flip the vector around to its opposite direction and then stretch it in that new direction.</p><p>Hence, the name &#8220;scalar&#8221; is used for scaling.</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>In mathematics, a <strong>field</strong> is a set equipped with two operations (typically called addition and multiplication) that satisfy certain properties, such as associativity, commutativity, distributivity, the existence of additive and multiplicative identities, and the existence of additive and multiplicative inverses for every element except the additive identity.</p><p>The field of Real Numbers, denoted by the &#8220;R,&#8221; represents the set of all real numbers. It is most commonly encountered in calculus, real analysis, and many applied fields.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Malicious Time-to-Live (TTL) manipulation]]></title><description><![CDATA[A high-level explanation on malicious TTL manipulation and packet fragmentation.]]></description><link>https://www.emdeh.com/p/malicious-time-to-live-ttl-manipulation</link><guid isPermaLink="false">https://www.emdeh.com/p/malicious-time-to-live-ttl-manipulation</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Sun, 17 Mar 2024 21:10:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fmMt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fmMt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fmMt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fmMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fmMt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!fmMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5d9a773-3aeb-4994-8d8f-b5f2b9bee46b_1024x1024.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="pullquote"><p>Threat actors can manipulate their IP packets&#8217; Time-to-Live (TTL) value to evade detection while performing network reconnaissance and even help bypass firewalls, Intrusion Detection Systems (IDS), and Intrusion Prevention Systems (IPS).</p></div><h1>What is TTL</h1><p>Time-to-live (TTL) is a computing mechanism that limits the lifespan or validity of data in a network. TTL is a value included in IP packets that tells a network router how many hops (transfers from one network segment to another) the packet is allowed before it should be discarded. The TTL value prevents data packets from circulating indefinitely and causing network congestion.</p><p>TTL values are set in the header of IP packets. The TTL value is an 8-bit field ranging from 0 to 255. The value set in this field determines the maximum number of routers (hops) the packet can pass through before it is discarded or dropped.</p><p>The initial TTL value of a packet can vary depending on the operating system or the application generating the packet. Some common initial values used by different systems include:</p><ul><li><p>Linux-based systems: 64</p></li><li><p>Windows-based systems: 128</p></li><li><p>Network equipment like Cisco routers: 255</p></li></ul><p>The choice of the initial TTL value is a balance between ensuring that packets have enough hops to reach their destination under normal conditions and preventing packets from circulating unnecessarily, which is important to mitigate network congestion.</p><h2>What Happens When the TTL Reaches 0</h2><p>When the TTL value of an IP packet decrements to 0, it indicates that the packet has reached the maximum allowed number of hops (routers) without reaching its intended destination. The router that decrements the TTL value to 0 will discard the packet and typically send an ICMP (Internet Control Message Protocol) Time Exceeded message back to the source IP address. This ICMP message notifies the sender that the packet was not delivered due to the TTL expiring.</p><div><hr></div><h1>TTL Manipulation</h1><h2>Reconnaissance and Probing</h2><p>Intentionally manipulating the TTL with lower-than-normal values can be used in network reconnaissance. By controlling the TTL value, a threat actor can elicit the ICMP Time Exceeded response from various appliances on a network. These responses can help infer the overall layout, map network paths, or identify the presence and location of specific appliances.</p><h2>Bypassing Security Measures</h2><p>Another application of TTL manipulation involves deceiving IDS and IPS appliances to smuggle malicious packets past these security controls.</p><p>This technique operates on the principle of sending two sets of packets with carefully selected TTL values and identical sequence numbers, exploiting the way some security devices handle packet inspection and filtering.</p><p><strong>Initial Probing Packets</strong>: The threat actor sends a series of packets towards the target system with TTL values calibrated such that they expire right before reaching the target, yet after passing the IDS/IPS. These packets, designed to appear benign, prompt the IDS/IPS to log their sequences but ultimately discard them as they do not reach the destination due to TTL expiry.</p><p><strong>Follow-Up Malicious Packets</strong>: Subsequently, the attacker sends another set of packets with identical sequence numbers as the probing packets, but this time, containing a malicious payload. These packets are sent with TTL values that ensure they reach the target. The critical manipulation here lies in setting the TTL of the probing packets to expire just beyond the IDS/IPS, thus avoiding further inspection of the subsequent malicious packets.</p><p><strong>The IDS/IPS Deception</strong>: Many IDS/IPS configurations are optimised to reduce performance overhead, which includes minimising duplicate packet inspection. They might treat these follow-up packets as duplicates of the initial, already-checked sequence, thus not subjecting them to thorough scrutiny. Consequently, the packets carrying the malicious content bypass the IDS/IPS checks, reaching the target system unnoticed.</p><h2>Incorporating Fragmentation with TTL Manipulation</h2><p>Another method combines packet fragmentation with TTL manipulation to evade security controls. This technique leverages the fact that some security devices may not thoroughly inspect or reassemble fragmented packets.</p><p>By fragmenting malicious payloads and carefully setting the TTL values, attackers can craft packets that are less likely to be detected by traditional security mechanisms.</p><p>Fragmenting packets involves dividing the malicious payload into smaller fragments, making it more challenging for security devices to inspect packets and accurately identify and block harmful content.</p><p>Alongside fragmentation, the attacker manipulates the TTL values to ensure that the fragmented packets bypass the security devices with minimal scrutiny. The manipulated TTL values can help ensure that the fragments take a path through the network that avoids comprehensive inspection or takes advantage of devices that do not reassemble packets for inspection.</p><p>By carefully orchestrating the fragmentation and TTL settings, the attacker can potentially deliver the malicious payload past IDS, IPS, and firewalls. Once the fragments reach their target, they can be reassembled into the original malicious payload, executing the intended attack without being detected by the network&#8217;s security infrastructure.</p><h1>Mitigation and Real-world Application</h1><p>The effectiveness of these techniques in real-world scenarios can vary significantly. Modern Intrusion Detection and Prevention Systems are designed to mitigate such evasion tactics.</p><p>These systems often incorporate advanced algorithms and analysis of behaviour patterns to detect and counteract unusual TTL values and fragmented packet strategies.</p><p>To enhance network security against such TTL manipulation techniques, administrators can consider the following mitigation strategies:</p><ul><li><p><strong>Enhanced Packet Inspection</strong>: Configure IDS/IPS to perform in-depth packet inspections, including analysing fragmented packets and verifying packet integrity.</p></li><li><p><strong>Anomaly Detection</strong>: Implement anomaly-based detection systems that identify unusual traffic patterns, including atypical TTL values.</p></li><li><p><strong>Regular Updates and Patching</strong>: Keep security devices updated with the latest software patches and threat intelligence to defend against new and evolving tactics.</p></li><li><p><strong>Comprehensive Security Practices</strong>: Employ a multi-layered security approach that includes encryption, firewalls, and end-to-end monitoring to reduce reliance on any single point of failure.</p></li></ul><p>This advanced method illustrates the capacity for TTL manipulation in mapping network defences and its potential in crafting evasion strategies that exploit specific weaknesses in the security infrastructure&#8217;s logic and configuration.</p><h1>Conclusion</h1><p>Malicious TTL manipulation and packet fragmentation represent sophisticated evasion techniques that challenge traditional network security measures. Network administrators can better protect their infrastructure against these and other advanced threats by understanding and mitigating these tactics.</p>]]></content:encoded></item><item><title><![CDATA[GitHub - Managing upstream changes]]></title><description><![CDATA[An overview of how to manage upstream changes in a GitHub repository]]></description><link>https://www.emdeh.com/p/github-managing-upstream-changes</link><guid isPermaLink="false">https://www.emdeh.com/p/github-managing-upstream-changes</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Sun, 18 Feb 2024 21:24:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Mq6_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mq6_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mq6_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mq6_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Mq6_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!Mq6_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848f8111-409c-41f6-9e90-807aaaf6d812_1024x1024.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Introduction</h1><p>When a GitHub repository is forked, it can maintain a connection with the original codebase, which is called the <strong>upstream</strong> repository or branch. This connection means that the forked repository can be modified as needed, but if changes are made to the original, such as new features, they can be integrated into the forked version.</p><p>This article outlines the steps to pull changes from an upstream repository into a forked version. Specifically, it outlines how to pull changes into a separate branch for testing and then how to <strong>merge</strong> those changes into the main branch of the fork after testing and resolving any conflicts<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>.</p><h2>High-level workflow for Merging Upstream Changes:</h2><ol><li><p><strong>Creating a New Branch:</strong> When upstream changes need to be merged, create a new branch in the forked repository based on the forked repository&#8217;s main branch.</p></li><li><p><strong>Pulling Upstream Changes:</strong> Pull the changes from the upstream repository into this new branch. Resolve any conflicts here.</p></li><li><p><strong>Testing:</strong> Use this branch to test the deployment to ensure everything works as expected. For example, if it&#8217;s a website, run it locally from the new branch, or if it&#8217;s a deployment, deploy from the branch to confirm everything is in order.</p></li><li><p><strong>Creating a Pull Request:</strong> Once the branch with the upstream changes has been tested, create a Pull Request to merge this branch into the main branch. The Pull Request can be drafted during testing if necessary.</p></li><li><p><strong>Review and Merge:</strong> Review the Pull Request in GitHub. After any necessary approvals, merge the Pull Request.</p></li><li><p><strong>Delete the Branch:</strong> After the merge, the branch used to test the upstream changes can be deleted.</p></li></ol><h2>Prerequisites</h2><ul><li><p>Ensure Git is installed on the system.</p></li><li><p>Ensure access to the repository and its upstream repository.</p></li></ul><div><hr></div><h1>Steps</h1><h4>1. Navigate to the local repo</h4><p></p><h4>2. Update the local main branch</h4><p>Ensure the local <code>main</code> branch (or whichever branch will ultimately receive the tested upstream changes) is up to date with the remote repository.</p><pre><code><code>git checkout main 
# Checkout the local copy of the main branch

git pull origin main 
# Pull remote changes into the local copy of the main branch</code></code></pre><h4>3. Fetch changes from the upstream repository</h4><p>Fetch changes from the upstream repository without merging them.</p><pre><code><code>git fetch upstream</code></code></pre><h4>4. Create a new branch for testing the upstream changes</h4><p>Create a new branch based on the <code>main</code> branch to test the upstream changes.</p><blockquote><p><em><strong>This is important, as it protects the stability of the branch from which the code is deployed.</strong></em></p></blockquote><pre><code><code>git checkout -b upstream-changes main 
# Create a new branch called upstream-changes based off the main branch</code></code></pre><h4>5. Merge upstream changes into the new branch</h4><p>Merge the changes from the upstream repository into the new branch.</p><pre><code><code>git merge upstream/main</code></code></pre><div><hr></div><h4>Resolving merge conflicts</h4><p>If there are merge conflicts, Git will pause the merge process and mark the files that have conflicts. Here is how to resolve them:</p><ul><li><p>Open the conflicted files in VS Code.</p></li><li><p>Look for the areas marked as conflicts (usually indicated by <code>&lt;&lt;&lt;&lt;&lt;&lt;</code>, <code>======</code>, and <code>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</code>).</p></li><li><p>Manually edit the files to resolve the conflicts. Choose which changes to keep or combine as needed.</p></li><li><p>After resolving conflicts, add the files to staging: <code>git add .</code></p></li><li><p>Then, continue the merge process: <code>git merge --continue</code></p></li><li><p>Once all conflicts are resolved and the merge is successful, proceed with the next steps.</p></li></ul><div><hr></div><h4>6. Push the new branch to Github</h4><p>It&#8217;s good practice to push the newly created branch with the upstream changes to the remote repository.</p><pre><code><code>git push origin upstream-changes</code></code></pre><h4>7. Open a Pull Request in GitHub</h4><p>Now, the Pull Request can be opened in draft.</p><blockquote><p><em>Be careful that the Pull Request is proposing to pull the </em><code>upstream-changes</code> branch into your own <code>main</code> branch, and <strong>not</strong> the <code>main</code> branch of the upstream repository.</p></blockquote><ul><li><p>Go to the repository in GitHub.</p></li><li><p>Open a Pull Request for the <code>upstream-changes</code> branch against the <code>main</code> branch.</p></li><li><p>This usually initiates any review process.</p></li></ul><blockquote><p><em>Do not merge it yet.</em></p></blockquote><h4>8. Deploy the Test branch</h4><p>Deploy or run the <code>upstream-changes</code> branch locally, or undertake whatever steps are required to confirm the changes.</p><h4>9. Review and merge the pull request</h4><p>If the tests are successful, merge the changes into main by merging the pull request into the <code>main</code> branch through the GitHub interface<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p><h4>10. Update the local main branch and clean up</h4><p>After merging the pull request, update the local <code>main</code> branch and then delete the test branch.</p><pre><code><code>git checkout main 
# Switch back to the main branch

git pull origin main 
# Pull the remote version of main to the local copy so it is up-to-date with the recent merge

git branch -d upstream-changes 
# Delete the local copy of the branch used to test the upstream changes

git push origin --delete upstream-changes 
# Delete the remote copy of the branch used to test the upstream changes</code></code></pre><h4>11. Redeploy from the main branch</h4><p>If required, it&#8217;s good practice to now re-deploy the codebase from the <code>main</code> branch.</p><div><hr></div><h1>Conclusion</h1><p>This process ensures that changes from the upstream repository are tested in isolation before being integrated into the main branch, minimising the risk of disruption to the main codebase.</p><h4>A quick note on <code>Git Fetch</code> vs. <code>Git Pull</code></h4><p>In Git, both <code>git fetch</code> and <code>git pull</code> are commands used to update local repository copies from a remote source. However, they serve different purposes and operate in distinct ways.</p><ul><li><p><code>git fetch</code> retrieves updates from a remote repository but doesn&#8217;t automatically merge them into the current working branch. When <code>git fetch upstream</code> is executed, for instance, Git fetches any new work that has been pushed to the upstream repository since the last fetch, updating the local remote-tracking branches (like upstream/main). However, <em>the working directory remains unchanged</em>. This command is useful for reviewing changes before integrating them into the local branch.</p></li><li><p><code>git pull</code>, on the other hand, is a more aggressive command that not only fetches updates from the remote repository but also automatically merges them into your current working branch. Essentially, <code>git pull</code> is a combination of <code>git fetch</code> followed by <code>git merge</code>. When executed <code>git pull origin main</code>, Git fetches the changes from the main branch of the remote named origin and immediately attempts to merge them into the current working branch. This command is handy for quickly updating local branches with the latest changes from the remote, assuming they&#8217;re ready to be merged without a review process.</p></li></ul><p>In Summary <code>git fetch</code> is when the changes require review before merging. Use <code>git pull</code> when integrating the remote changes immediately into the local branch without a preliminary review is not a concern.</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>This is by no means meant to represent a best practice - it is simply a process that works for me in managing repositories that maintain a link to the original source.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><h4>What type of merge to use?<br><br><em><strong>When to use Merge Commit</strong></em></h4><p>Opt for a merge commit when you want to preserve the exact history of changes, including the individual commits, from a feature branch without altering the commit history. This approach is beneficial when you want to maintain a visual representation of the feature branch within the main branch, making it easier to track and understand the flow of changes. It&#8217;s especially useful for complex features or significant changes that involve multiple developers or require detailed historical context for future reference.</p><p>The merge commit approach adds a new commit to the main branch that &#8220;merges&#8221; the histories, ensuring that the main branch&#8217;s history reflects the addition of the feature or changes from the feature branch as a merge. This method keeps the history of both branches intact and provides a clear merge point that can be referenced in the future</p><blockquote><p><em>If Linear History is on and the branch being being merged into is protected, the only options may be <strong>Rebase</strong> or <strong>Squash</strong>.</em></p></blockquote><h5><em>When to use Rebase</em></h5><p>Use this when you want to maintain a detailed commit history from the feature/test branch in the main branch. It&#8217;s suitable for code changes where each commit&#8217;s history is important for context, such as new features or significant code revisions.</p><h5><em>When to use Squash</em></h5><p>Opt for this when dealing with a series of minor or incremental changes, such as documentation updates or small tweaks. It combines all feature branch commits into a single commit for a cleaner main branch history, making it ideal for simpler or less impactful changes.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Human Disruption - Breaking the Cyber Kill Chain]]></title><description><![CDATA[A brief overview of the importance of the human element in disrupting cyber kill chains.]]></description><link>https://www.emdeh.com/p/human-disruption-breaking-the-cyber</link><guid isPermaLink="false">https://www.emdeh.com/p/human-disruption-breaking-the-cyber</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Wed, 22 Nov 2023 23:34:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bn3d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bn3d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bn3d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 424w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 848w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bn3d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bn3d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 424w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 848w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!bn3d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c3a7438-9750-489f-a429-afcf3b592736_1792x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Contents</h2><ul><li><p><a href="https://emdeh.substack.com/i/145239694/what-is-the-cyber-kill-chain-model">What is the Cyber Kill Chain Model?</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/applying-the-human-element-to-cyber-kill-chains">Applying the Human Element to Cyber Kill Chains</a></p><ul><li><p><a href="https://emdeh.substack.com/i/145239694/reconnaissance">Reconnaissance</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/weaponisation">Weaponisation</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/delivery">Delivery</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/exploitation">Exploitation</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/installation-persistence">Installation (Persistence)</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/command-and-control-c">Command &amp; Control (C2)</a></p></li><li><p><a href="https://emdeh.substack.com/i/145239694/actions-on-objectives">Actions on Objectives</a></p></li></ul></li><li><p><a href="https://emdeh.substack.com/i/145239694/conclusion">Conclusion</a></p></li></ul><div><hr></div><h1>What is the Cyber Kill Chain Model?</h1><p>The &#8216;kill chain&#8217; concept is a borrowed military term that outlines the stages of an adversary&#8217;s attack methodology. Intercepting attackers at multiple points increases the likelihood of disrupting the threat or forcing the adversary to take more detectable actions.</p><p>The prevailing application of kill chain models focuses on technology and often overlooks the human element. Incorporating human aspects, like security awareness and end-user education, isn&#8217;t just another security control; it&#8217;s a unique approach to managing the fallibility humans introduce into any system or process.</p><div class="pullquote"><p>Kill chain models focus on technology and overlook the human element. Incorporating the human aspects, like end-user education is more than just another security control.</p></div><h1>Applying the Human Element to Cyber Kill Chains</h1><p>Distilling a kill chain into its constituent steps is often highly context-dependent. In general, however, it can be conceptualised into the following categories:</p><ul><li><p>Reconnaissance</p></li><li><p>Weaponisation</p></li><li><p>Delivery</p></li><li><p>Exploitation</p></li><li><p>Persistence</p></li><li><p>Command and Control</p></li><li><p>Actions on objectives</p></li></ul><p>The following will briefly consider the human element at each step and how it can disrupt or detect an attack.</p><h2>Reconnaissance</h2><blockquote><p><em>The threat actor conducts preliminary information gathering.</em></p></blockquote><p>Understanding their role as potential targets, an informed workforce or user base can significantly reduce information leakage by exercising caution on social media, verifying identities over the phone, and securely disposing of sensitive documents. While not a strategy that can mitigate the risk completely, these practices can impede an attacker&#8217;s reconnaissance efforts.</p><h2>Weaponisation</h2><blockquote><p><em>The threat actor prepares appropriate tactics, techniques, and tools without direct contact with the target.</em></p></blockquote><p>Limited security measures can disrupt this phase, except where a threat actor conducts preliminary testing on the target. In this case, an informed user base can act as additional &#8220;sensors&#8221; of Indicators of Compromise (IoCs).</p><h2>Delivery</h2><blockquote><p><em>The threat actor launches the attack against the target.</em></p></blockquote><p>While technical solutions strive to block this phase, human intuition and adaptability can also be crucial. People are often the first line of defence in recognising and countering attacks, especially those involving social engineering. Regular training and awareness programs can significantly enhance this human firewall.</p><p>Highly observant technical staff with a natural sense of curiosity and a keen eye for detail can also be invaluable. Take, for example, the case of a Microsoft Engineer who noted a few subtle but odd symptoms around a sub-component of a Linux package. After investigating, it ultimately led to the identification that the upstream packages had been backdoored.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://mastodon.social/@AndresFreundTec/112180406142695845" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NUAO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 424w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 848w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 1272w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NUAO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png" width="588" height="359" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce91889d-5622-41d4-baba-dce41047cf45_588x359.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:359,&quot;width&quot;:588,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46551,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://mastodon.social/@AndresFreundTec/112180406142695845&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NUAO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 424w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 848w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 1272w, https://substackcdn.com/image/fetch/$s_!NUAO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce91889d-5622-41d4-baba-dce41047cf45_588x359.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Exploitation</h2><blockquote><p><em>The threat actor executes the attack by, for example, exploiting vulnerabilities.</em></p></blockquote><p>Educated users are more likely to maintain updated systems and use security software, reducing the chances of successful exploitation. Awareness about phishing, suspicious links, and attachments can prevent many exploitation attempts.</p><h2>Installation (Persistence)</h2><blockquote><p><em>The threat actor establishes persistence to a compromised target.</em></p></blockquote><p>If an attack has reached this stage, technical solutions are arguably the best line of defence, but humans can still play a crucial role. With their daily interaction with systems, users are ideally positioned to notice anomalies in performance or behaviour that could be symptomatic of an attack. Encouraging users to report unusual activities can lead to early detection.</p><h2>Command &amp; Control (C2)</h2><blockquote><p><em>Compromised systems contact the threat actor&#8217;s external infrastructure for further instructions.</em></p></blockquote><p>Proactive threat hunting aims to identify suspicious communications. Educated users who understand the importance of network hygiene and the signs of a compromised system can contribute by reporting unusual outbound traffic or behaviours.</p><h2>Actions on Objectives</h2><blockquote><p><em>The threat actor pursues their ultimate goal within the compromised network.</em></p></blockquote><p>Users' security-conscious behaviours&#8212;such as using strong passwords and scrutinising login activities&#8212;can complicate attackers&#8217; efforts, enhancing the organisation&#8217;s detection capabilities and delaying lateral movement, data exfiltration, or privilege escalation. Encouraging a culture of security and vigilance can significantly disrupt an adversary&#8217;s ability to achieve their objectives.</p><div><hr></div><h1>Conclusion</h1><p>Breaking a cyber kill chain is not solely the domain of technological solutions. Organisations can create a more robust defence against cyber threats by incorporating the human element at each stage. Security awareness and end-user education are critical components that enhance the overall security posture, making it more difficult for attackers to succeed.</p>]]></content:encoded></item><item><title><![CDATA[The Mosaic Effect]]></title><description><![CDATA[See your identity pieced together from stolen data.]]></description><link>https://www.emdeh.com/p/the-mosaic-effect</link><guid isPermaLink="false">https://www.emdeh.com/p/the-mosaic-effect</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Thu, 02 Nov 2023 23:45:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0Qep!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0Qep!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0Qep!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0Qep!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A minimalist, black and white illustration representing the mosaic effect in cyber security. The image features thin lines and a dark theme. It shows a fragmented mosaic pattern where each piece represents different aspects of cyber security, such as locks, shields, network symbols, and human figures. These pieces are interconnected, symbolizing the comprehensive and interconnected nature of cyber security defenses. The background is mostly black, and the mosaic pieces are outlined in white, creating a stark contrast.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A minimalist, black and white illustration representing the mosaic effect in cyber security. The image features thin lines and a dark theme. It shows a fragmented mosaic pattern where each piece represents different aspects of cyber security, such as locks, shields, network symbols, and human figures. These pieces are interconnected, symbolizing the comprehensive and interconnected nature of cyber security defenses. The background is mostly black, and the mosaic pieces are outlined in white, creating a stark contrast." title="A minimalist, black and white illustration representing the mosaic effect in cyber security. The image features thin lines and a dark theme. It shows a fragmented mosaic pattern where each piece represents different aspects of cyber security, such as locks, shields, network symbols, and human figures. These pieces are interconnected, symbolizing the comprehensive and interconnected nature of cyber security defenses. The background is mostly black, and the mosaic pieces are outlined in white, creating a stark contrast." srcset="https://substackcdn.com/image/fetch/$s_!0Qep!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!0Qep!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b7edf43-7a80-4d51-a64f-1ddb16ea9a60_1024x1024.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Introduction</h1><p>An older post resurrected from another platform because it will always be relevant.</p><p>Despite the recent high-profile breaches, the impact of the mosaic effect remains understated. This <a href="https://www.abc.net.au/news/2023-05-18/data-breaches-your-identity-interactive/102175688">interactive article</a> from ABC and the creator of <a href="https://haveibeenpwned.com/">Have I been Pwned</a> visually (and scarily) gets the point across with mosaics! It is a timely reminder to minimise the PII we give out and not to reuse passwords.</p><h1>What is the Mosaic Effect?</h1><p>The mosaic effect demonstrates how seemingly innocuous pieces of information, when combined, can create a detailed and revealing picture of an individual&#8217;s identity, much like tiles forming a complete mosaic. No matter how insignificant each data breach may seem, it can contribute another tile to this unintended portrait. This piecemeal approach to data collection and the subsequent risk of re-identification in data sets that were thought to be anonymous or de-identified is an increasingly prominent concern in the digital age.</p><p>The risk also extends beyond the individual and into organizations. Inadvertent disclosure of sensitive information through various seemingly harmless data releases can lead to security vulnerabilities, making companies an unwitting participant in this digital patchwork of information.</p><h1>What can you do?</h1><p>Aside from minimising PII and not reusing passwords, the more cautious among us may want to consider using masked emails and pseudo-anonymising PII for online services.</p><p>Masked emails are aliases that forward to your real email, helping keep your actual email address out of the public domain. This can be a valuable tool in combating phishing attempts. Pseudo-anonymising data or replacing private identifiers with fake identifiers or pseudonyms can reduce the risk of identity theft or data misuse.</p><p>Password managers are more than just convenience tools; they&#8217;re a crucial component in the fight against the mosaic effect. They encourage strong, unique passwords for every account and service, making it difficult for attackers to decipher your digital identity even if they gain access to one set of credentials.</p><p>The mosaic effect underscores the need for a proactive approach to data privacy. By being vigilant about the data we share and how we protect it, we can thwart the efforts of those who seek to piece together our digital lives. Protecting our real identities only takes a little effort but can profoundly impact our digital security and privacy.</p>]]></content:encoded></item><item><title><![CDATA[SOCKS4 vs SOCKS5]]></title><description><![CDATA[Differences between SOCKS 4 and 5.]]></description><link>https://www.emdeh.com/p/socks4-vs-socks5</link><guid isPermaLink="false">https://www.emdeh.com/p/socks4-vs-socks5</guid><dc:creator><![CDATA[emdeh]]></dc:creator><pubDate>Mon, 30 Oct 2023 22:59:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JP_6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JP_6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JP_6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 424w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 848w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JP_6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JP_6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 424w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 848w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!JP_6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F749aef3e-5595-494d-962d-7d24114b44e5_1792x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>What is SOCKS</h1><p>SOCKS stands for "SOCKet Secure" and is a protocol used for proxy servers. It operates at Layer 5 (Session Layer) of the OSI model, which means it can manage sessions and connections between different applications and servers. The protocol establishes a TCP connection to another server behind a firewall, allowing data to pass through a proxy server. </p><div class="pullquote"><p>The term &#8220;socket&#8221; refers to the combination of an IP address and port number.</p></div><h2>Is it tunnelling?</h2><p>SOCKS can be considered a form of tunnelling. Here&#8217;s how it works in more detail:</p><ul><li><p><strong>Connection Establishment</strong>: When a client wants to connect to a server behind a firewall, it first connects to the SOCKS proxy server. The proxy then establishes a connection to the target server on behalf of the client.</p></li><li><p><strong>Data Transmission</strong>: The data sent by the client is encapsulated within the SOCKS protocol and forwarded to the proxy server. The proxy server then decapsulates the data and sends it to the target server. This process effectively tunnels the data through the proxy server.</p></li><li><p><strong>Firewall Bypass</strong>: By encapsulating the data and routing it through the SOCKS proxy, the protocol can bypass firewall restrictions that might block direct communication between the client and the server. The firewall only sees the connection between the client and the proxy server, not the target server.</p></li><li><p><strong>Session Management</strong>: Operating at the Session Layer, SOCKS handles the establishment, maintenance, and termination of the session between the client and the target server. This ensures that the connection remains stable and data is transmitted reliably.</p></li></ul><div class="pullquote"><p>The protocol can bypass firewall restrictions that might block direct communication between the client and the server by encapsulating the data and routing it through the proxy.</p></div><p>In summary, SOCKS acts as an intermediary that routes data between a client and a server, encapsulating and decapsulating the data to bypass firewalls and manage sessions effectively. This tunnelling capability makes it a powerful, secure, and flexible network communication tool.</p><h2>Differences between SOCKS4 and SOCKS5</h2><h3>SOCKS4</h3><ul><li><p><strong>Protocol Support</strong>: Supports TCP only, making it suitable for applications that use this protocol for data transmission.</p></li><li><p><strong>Authentication</strong>: Doesn&#8217;t support authentication natively. Anyone with the proxy address and port can use it, which can be a security risk in open networks.</p></li><li><p><strong>Hostname Resolution</strong>: It cannot resolve hostnames; it requires the client to resolve the hostname to an IP address before initiating the connection.</p></li><li><p><strong>Use Case</strong>: Suitable for simple applications that require basic proxy functionality without the need for advanced security or UDP support.</p></li></ul><h3>SOCKS5</h3><ul><li><p><strong>Protocol Support</strong>: Supports both TCP and UDP, making it versatile for a wider range of applications, including those requiring real-time data transmission like VoIP.</p></li><li><p><strong>Authentication</strong>: Provides a range of authentication mechanisms, including:</p><ul><li><p>No authentication</p></li><li><p>Username/password</p></li><li><p>GSS-API (Generic Security Services Application Program Interface) for more robust security needs.</p></li></ul></li><li><p><strong>Hostname Resolution</strong>: Resolves hostnames, which means you can pass a domain name that SOCKS5 will resolve for you, simplifying client configurations.</p></li><li><p><strong>IPv6 Support</strong>: SOCKS5 can handle IPv6 addresses, making it compatible with modern networks.</p></li><li><p><strong>Use Case</strong>: Preferred for more complex environments where security, flexibility, and support for UDP are required.</p></li></ul><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/BsxJm/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd6ade5b-07fc-44f0-adca-f3b64839c1fc_1260x660.png&quot;,&quot;thumbnail_url_full&quot;:&quot;&quot;,&quot;height&quot;:239,&quot;title&quot;:&quot;| Created with Datawrapper&quot;,&quot;description&quot;:&quot;Create interactive, responsive &amp; beautiful charts &#8212; no code required.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/BsxJm/1/" width="730" height="239" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p></p><h2>Advantages of SOCKS5 over SOCKS4</h2><ol><li><p><strong>Enhanced Security</strong>: SOCKS5 supports various authentication methods, ensuring that only authorised users can access the proxy.</p></li><li><p><strong>Flexibility</strong>: Supports both TCP and UDP protocols, which is beneficial for applications requiring different types of data transmission.</p></li><li><p><strong>Simplified Configuration</strong>: Can resolve hostnames and supports IPv6, reducing the complexity of client configurations.</p></li><li><p><strong>Improved Performance</strong>: The ability to use UDP can lead to better performance in certain applications, such as gaming or streaming, where real-time data transmission is crucial.</p></li></ol><h2>Conclusion</h2><p>SOCKS proxies are useful tools for navigating network restrictions and enhancing privacy. While SOCKS4 is simpler and sufficient for basic needs, SOCKS5 offers significant improvements in security, flexibility, and ease of use, making it the preferred choice for modern applications.</p><p>This version provides a more comprehensive overview of the SOCKS protocol and its versions by expanding on the details of authentication methods, hostname resolution, and use cases.</p>]]></content:encoded></item></channel></rss>