You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
20 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.0.0">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2020-02-23T21:50:34+00:00</updated><id>http://localhost:4000/feed.xml</id><entry><title type="html">How Does Encryption Work, in Theory?</title><link href="http://localhost:4000/2020/02/19/rsa2.html" rel="alternate" type="text/html" title="How Does Encryption Work, in Theory?" /><published>2020-02-19T00:00:00+00:00</published><updated>2020-02-19T00:00:00+00:00</updated><id>http://localhost:4000/2020/02/19/rsa2</id><content type="html" xml:base="http://localhost:4000/2020/02/19/rsa2.html">&lt;p&gt;There are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in &lt;a href=&quot;/2020/01/26/rsa1.html&quot;&gt;this article&lt;/a&gt; why encryption is important, and why &lt;em&gt;you&lt;/em&gt; should care about it.&lt;/p&gt;
&lt;p&gt;We will start by looking at in-person, offline encryption.&lt;/p&gt;
&lt;h2 id=&quot;cryptography-we-do-everyday&quot;&gt;Cryptography We Do Everyday&lt;/h2&gt;
&lt;p&gt;We encrypt things all the time without even thinking about it.
If you spend a significant amount of time with the same group of friends, your will tend of develop common codes that may not make sense to others outside the group.
For example: for years, my family called sombody falling from a sitting position “doing a Don”. There is a story of course—We knew a guy named Don who fell from his plastic beach chair in a rather hilarious way; “doing a Don” was born.&lt;/p&gt;
&lt;p&gt;These kind of minor dialects in speech are cryptographic in their own way. The truth is though, that we use cryptography much more than that!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Is cryptography any different than talking?
We say something other than what we mean, and then expect everyone is able to decipher the true meaning behind the words.
Only, I never do…” — Adapted from a scene in &lt;a href=&quot;https://www.benedictcumberbatch.co.uk/wordpress/wp-content/uploads/ScreenplayTIG.pdf&quot;&gt;The Imitation Game (p. 39-40)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;How many times have you hinted, flirted, and innuendoed to try to say “I find you very physically attractive”?
Have you told your friend that always stinks to wear more deoderent?
Have you ever had someone say the words “Im fine” when you know &lt;em&gt;for certain&lt;/em&gt; that they are indeed not okay?&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Words Said&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What can you do?&lt;/td&gt;
&lt;td&gt;I dont want to talk about this anymore.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I dont want to overstay my welcome.&lt;/td&gt;
&lt;td&gt;I want to go home now.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I dont like them and dont know why.&lt;/td&gt;
&lt;td&gt;They threaten my ego.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creepy&lt;/td&gt;
&lt;td&gt;Unattractive and friendly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All of these scenarios are perfect examples of &lt;del&gt;lies&lt;/del&gt; encryption! If we have the key to these codes, we can start to understand what people really mean.
Hopefully I have convinced you that you use &lt;del&gt;deceit&lt;/del&gt; cryptography on a regular basis in your life, so let us consider what a basic encryption method might be:&lt;/p&gt;
&lt;h2 id=&quot;grade-school-encryption&quot;&gt;Grade-School Encryption&lt;/h2&gt;
&lt;p&gt;Back when I was in middle school I used to pass notes like these:&lt;/p&gt;
&lt;p&gt;PIC&lt;/p&gt;
&lt;p&gt;This is a messege encrypted using the Caesar cipher. This encryption technique was used by Julius Caesar during the reign of the Roman Empire to “encrypt messeges of military significance.”&lt;a class=&quot;citation-link&quot; href=&quot;https://en.wikipedia.org/wiki/Caesar_chipher/&quot;&gt;[1]&lt;/a&gt;
This is one of the oldest and simplest methods of encryption known to us today.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/ceasar13.png&quot; alt=&quot;A diagram of a Ceasar Shift algorithm. A &amp;lt;-&amp;gt; N, B &amp;lt;-&amp;gt; O, et cetera.&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can try this out yourself by moving some letters forward in the alphabet.
An A turns into a B, B into C, C into D, et cetera.
In this case, “Hello!” would become “Ifmmp!”
That is just using a shift of one. You can use a shift of seven, for example, and then you would shift letters like so:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;A -&amp;gt; +7 -&amp;gt; H&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Q -&amp;gt; +7 -&amp;gt; X&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;T -&amp;gt; +7 -&amp;gt; A&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We should wrap-around to the beginning of the alphabet if there are no letters left.&lt;/p&gt;
&lt;h2 id=&quot;example-of-a-caesar-cipher&quot;&gt;Example of a Caesar Cipher&lt;/h2&gt;
&lt;p&gt;Lets setup a little story to illustrate the problems of encryption. We will have three characters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alice, a little girl with feelings for Bob&lt;/li&gt;
&lt;li&gt;Bob, a young boy with an addiction to pancakes&lt;/li&gt;
&lt;li&gt;Eve, a wee jealous girl scout who sits between Bob and Alice&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Alice really likes Bob and wants to tell Bob her feelings, so she writes “I love you, Bob! Please eat healthier!” on a sticky note.
She passes it to Eve, so Eve can pass it to Alices love interest.
However, in an unfortunate turn of events Eve reads the note herself, and decides not to give it to Bob.&lt;/p&gt;
&lt;p&gt;Oh the horror! Alice is without young love! How could she remedy this so that Bob can read her messege, but evil Eve can not?
Lets use the Caesar cipher to fix this problem.&lt;/p&gt;
&lt;p&gt;Let us assume that Alice and Bob already have a shared key, 7 for example. To encrypt this messege, we should shift our letters seven letters forward in the alphabet—just like the example above.&lt;/p&gt;
&lt;p&gt;PIC2&lt;/p&gt;
&lt;p&gt;Now Alices messege reads “P svcl fvb, Ivi! Wslhzl lha olhsaoply!”&lt;/p&gt;
&lt;p&gt;Now, when Alice sends her Romeo a little note, all he has to do is decrypt the text by shifting the letters down by 7.
&lt;a href=&quot;https://www.xarg.org/tools/caesar-cipher/&quot;&gt;Here is a site&lt;/a&gt; which can do longer pieces of text for you instead of doing it manually.&lt;/p&gt;
&lt;h2 id=&quot;problems&quot;&gt;Problems&lt;/h2&gt;
&lt;p&gt;Before the two love-birds start smooching on the branch of a big pine tree in the schoolyard, perhaps we should consider some problems with the Ceasar cipher.&lt;/p&gt;
&lt;h4 id=&quot;it-is-very-easy-to-break&quot;&gt;It is Very Easy to Break&lt;/h4&gt;
&lt;p&gt;Even Eve with her measly grade 4 math skills could easily start going through this messege with pen and paper and figure out any combination in a couple hours at maximum.
Imagine how easy this is for a computer?
This could be broken in a few microseconds even on an older processor like the Intel Core 2 Duo.&lt;/p&gt;
&lt;h4 id=&quot;no-secure-way-of-sharing-keys&quot;&gt;No Secure Way of Sharing Keys&lt;/h4&gt;
&lt;p&gt;We assumed in our previous example that Bob and Alice already have a shared key (seven) to encrypt and decrypt all of their messeges.
If Bob and Alice did not have a previous friendship and time to share secrets of this sort, there is no way to share their key with eachother without Eve also knowing.
This would defeat the entire purpose of obscuring the messege in the first place.&lt;/p&gt;
&lt;h4 id=&quot;universal-vulnerability-of-messeges&quot;&gt;Universal Vulnerability of Messeges&lt;/h4&gt;
&lt;p&gt;Every messege sent between the two parties uses the same code to encrypt and decrypt. If someone finds out the code once, all previous communications are comprimised.&lt;/p&gt;
&lt;h2 id=&quot;better-encryption-methods&quot;&gt;Better Encryption Methods&lt;/h2&gt;
&lt;p&gt;To combat the issues with easily breakable, shared-key cryptography, we can turn to the beautiful beast that is &lt;a href=&quot;https://en.wikipedia.org/wiki/Public-key_cryptography&quot;&gt;Asymetric Cryptography&lt;/a&gt;.
I will discuss this more in another article, but for the technically inclined:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/RSA_(cryptosystem)&quot;&gt;RSA&lt;/a&gt;/&lt;a href=&quot;https://en.wikipedia.org/wiki/Elliptic-curve_cryptography&quot;&gt;EC&lt;/a&gt; provides &lt;em&gt;very&lt;/em&gt; large cryptographic keys. It would be impossible for a human to encrypt or decrypt a messege manually.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=GSIDS_lvRv4&quot;&gt;Asymetric cryptography&lt;/a&gt; provides four keys, instead of just one; stopping evesdroppers from listening in on your secret conversations—even if you do not have the change to exchange keys in advance.&lt;/li&gt;
&lt;/ol&gt;</content><author><name>tait</name></author><summary type="html">There are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in this article why encryption is important, and why you should care about it.</summary></entry><entry><title type="html">Is Encryption Worth It?</title><link href="http://localhost:4000/2020/01/26/rsa1.html" rel="alternate" type="text/html" title="Is Encryption Worth It?" /><published>2020-01-26T00:00:00+00:00</published><updated>2020-01-26T00:00:00+00:00</updated><id>http://localhost:4000/2020/01/26/rsa1</id><content type="html" xml:base="http://localhost:4000/2020/01/26/rsa1.html">&lt;p&gt;What is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your businesss secret to stay ahead of the competition?&lt;/p&gt;
&lt;p&gt;Now at first these questions may seem not completely related. There is a point though: You likely sent all of this information over the internet.&lt;/p&gt;
&lt;p&gt;When you send that messege to your friend or business partner, why is it that any person cant just listen to the signals coming from your phone or laptop and know what you sent to your friend or colleague? The answer: encryption.&lt;/p&gt;
&lt;p&gt;First, some background about internet privacy. You cant have a conversation about internet encryption and privacy without discussing the man himself:&lt;/p&gt;
&lt;h3 id=&quot;snowden&quot;&gt;Snowden&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Edward_Snowden&quot; target=&quot;_blank&quot;&gt;Edward Joseph Snowden&lt;/a&gt; is an ex-NSA, ex-CIA employee who felt the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fourth_Amendment_to_the_United_States_Constitution&quot; target=&quot;_blank&quot;&gt;United States 4th Ammendment&lt;/a&gt; was being violated by their programs of msas survailence.
Snowden was raised a staunch establishmentarian conservative; his girlfriend Lisndey however, slowly started changing his mind. Snowden became very influenced by the ideology of &lt;a href=&quot;https://en.wikipedia.org/wiki/Populism&quot; target=&quot;_blank&quot;&gt;populism&lt;/a&gt;.
His populist thinking is shown very clearly when he explains his reasoning for his disclosure of humongous troves of NSA documents.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“My sole motive is to inform the public as to that which is done in their name and that which is done against them.”
&lt;a href=&quot;https://www.theguardian.com/world/video/2013/jun/09/nsa-whistleblower-edward-snowden-interview-video&quot; target=&quot;_blank&quot;&gt;Edward Snowden&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Snowdens first set of leaks went public in &lt;a href=&quot;https://www.theguardian.com/world/2013/sep/05/nsa-gchq-encryption-codes-security&quot; target=&quot;_blank&quot;&gt;The Gaurdian&lt;/a&gt;, &lt;a href=&quot;https://www.nytimes.com/2013/06/10/us/former-cia-worker-says-he-leaked-surveillance-data.html&quot; target=&quot;_blank&quot;&gt;The New York Times&lt;/a&gt;, and &lt;a href=&quot;https://www.propublica.org/article/the-nsas-secret-campaign-to-crack-undermine-internet-encryption&quot; target=&quot;_blank&quot;&gt;ProPublica&lt;/a&gt; in late 2013;
people started to realize that their governments and internet service providers (ISPs) &lt;strong&gt;are&lt;/strong&gt; listening. People understood there might be more sinister motives than “national security” at play.&lt;/p&gt;
&lt;p&gt;Personally, I have seen a lot of non-tech-savy individuals using security-conscious software when I am helping them fix a problem.
In fact, there was one time I saw a collage student from rural Alberta who had a VPN running on her phone. This impressed me!&lt;/p&gt;
&lt;h3 id=&quot;encryption-on-the-web&quot;&gt;Encryption on The Web&lt;/h3&gt;
&lt;p&gt;The type of encryption used on the web is called: HyperText Transfer ProtocolSecure (HTTPS).
This kind of encryption stops two things from happening: A) it stops the information you are sending and recieving online from being seen by easvesdroppers and criminals, and B) stops those same third-parties from tampering with the data.&lt;/p&gt;
&lt;p&gt;Without HTTPS it is possible for sombody to listen in and change the data being sent between you and a server.&lt;/p&gt;
&lt;p&gt;Only in recent years has HTTPS become near-universal across the web. It is used even on the simplest sites these days: this one included. After 2013, people became weary of government, criminal, and ISP interference with their web traffic.
This can be backed up by statistics:
The level of encrypted web traffic around the time of the Snowden leaks was around 30 percent. It was mostly used by banks, email providers, government, and journalists.
At the turn of the 2020s however, this has risen to nearly 90 percent among U.S. users of Firefox.
Japan lags slightly behind with 80 percent encrypted traffic.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&quot;/assets/img/encrypted-web-traffic.png&quot; alt=&quot;Use of encrypted web traffic incresing over time.&quot; /&gt;
&lt;figcaption&gt;
More at: &lt;a href=&quot;https://letsencrypt.org/stats/&quot; target=&quot;_blank&quot;&gt;Let's Encrypt&lt;/a&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is just the data we know of. You can disable the &lt;a href=&quot;https://en.wikipedia.org/wiki/Telemetry#Software&quot; target=&quot;_blank&quot;&gt;telemetry&lt;/a&gt; settings in Firefox, and it is very likely that hardcore privacy advocates would disable this data collection, so perhaps the amount of encrypted web traffic is slightly higher.&lt;/p&gt;
&lt;h3 id=&quot;what-about-rsa&quot;&gt;What about RSA?&lt;/h3&gt;
&lt;p&gt;RSA is an encryption method named after the initials of the inventors sir names: Ron &lt;strong&gt;R&lt;/strong&gt;ivest, Adi &lt;strong&gt;S&lt;/strong&gt;hamir, and Leonard &lt;strong&gt;A&lt;/strong&gt;dleman. It uses the mathematical “factoring problem” to secure communication. The details of this specific type of encryption will be discussed in an article soon to come.&lt;/p&gt;</content><author><name>tait</name></author><summary type="html">What is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your businesss secret to stay ahead of the competition?</summary></entry><entry><title type="html">Padding And Margin</title><link href="http://localhost:4000/2020/01/22/padding-and-margin.html" rel="alternate" type="text/html" title="Padding And Margin" /><published>2020-01-22T00:00:00+00:00</published><updated>2020-01-22T00:00:00+00:00</updated><id>http://localhost:4000/2020/01/22/padding-and-margin</id><content type="html" xml:base="http://localhost:4000/2020/01/22/padding-and-margin.html">&lt;p&gt;Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.&lt;/p&gt;
&lt;p&gt;Here is an image from the World Wide Web Consortium (W3C) who sets the standards for the web.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/w3c-padding-margin.png&quot; alt=&quot;The W3C standard for padding, margin, borders and width. Width encompases the inner element + padding; the border then encompases it. The margin is the space beyond the border and in between other elements.&quot; title=&quot;W3C border, padding, margin standard.&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now although this image shows all the different types of spacing as equal, the majority of the time these will mostly be padding (inner) and margin (outer). Padding is the inner space between the element and its border; margin is the outer space between two different elements.&lt;/p&gt;
&lt;p&gt;Within the margin the user is unable to press any links or execute any javascript code. It is &lt;em&gt;empty&lt;/em&gt; space. If each &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;link&amp;gt;&lt;/code&gt; on your navigation bar has 10 pixels of margin, then there would be 20 pixels in between each &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;link&amp;gt;&lt;/code&gt; that would &lt;em&gt;not&lt;/em&gt; be clickable by the user.&lt;/p&gt;
&lt;p&gt;If you have &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;link&amp;gt;&lt;/code&gt;s on your navigation bar with &lt;em&gt;padding&lt;/em&gt; set to 20 pixels, however, then there will be 20 pixels on each side of the &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;link&amp;gt;&lt;/code&gt; text where the user &lt;em&gt;is&lt;/em&gt; able to click.&lt;/p&gt;
&lt;p&gt;If that part is confusing, try thinking about it in terms of whether &lt;code class=&quot;highlighter-rouge&quot;&gt;background-color&lt;/code&gt; would apply.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Padding&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Margin&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Spacing&lt;/td&gt;
&lt;td&gt;within element&lt;/td&gt;
&lt;td&gt;between elements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;background-color&lt;/code&gt; applies&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In summary:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Padding&lt;/strong&gt;: the space within a tag which is still part of the same tag. &lt;code class=&quot;highlighter-rouge&quot;&gt;background-color&lt;/code&gt; applies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Margin&lt;/strong&gt;: the space in between two seperate tags. &lt;code class=&quot;highlighter-rouge&quot;&gt;background-color&lt;/code&gt; does not apply; it is empty space.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Border&lt;/strong&gt;: the space in between the two; it surrounds the padding, but is not the margin. It looks nice somtimes, but it has no non-visual function. &lt;code class=&quot;highlighter-rouge&quot;&gt;background-color&lt;/code&gt; does not apply.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope this covers the basics of margin and padding! Happy coding!&lt;/p&gt;</content><author><name>tait</name></author><summary type="html">Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</summary></entry></feed>