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.

986 lines
64 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-06-25T18:47:21+00:00</updated><id>http://localhost:4000/feed.xml</id><entry><title type="html">How to use tmux to send and receive things from your Minecraft server</title><link href="http://localhost:4000/2020/06/25/tmux-minecraft.html" rel="alternate" type="text/html" title="How to use tmux to send and receive things from your Minecraft server" /><published>2020-06-25T00:00:00+00:00</published><updated>2020-06-25T00:00:00+00:00</updated><id>http://localhost:4000/2020/06/25/tmux-minecraft</id><content type="html" xml:base="http://localhost:4000/2020/06/25/tmux-minecraft.html">&lt;p&gt;So recently I had problem.
I run a Minecraft server on a big Linux computer I have running in my room.
Now, as a system administrator it is very helpful to be able to run some simple commands without needing to login with my key, password, TFA, etc.
It is, frankly, a lot of work.
Especially when I really just want to be playing games but I just need to check something quickly.&lt;/p&gt;
&lt;p&gt;So for simple things like finding out of the network, CPU, memory or disk usage is my bottleneck, I wrote this really nifty script to connect the world of Minecraft and the Linux shell.&lt;/p&gt;
&lt;p&gt;My completed solution for what I needed can be found at &lt;a href=&quot;https://github.com/TTWNO/termcraft/&quot;&gt;https://github.com/TTWNO/termcraft&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want some of the implementation details, stick around.&lt;/p&gt;
&lt;h2 id=&quot;solution&quot;&gt;Solution&lt;/h2&gt;
&lt;p&gt;So to solve this interesting problem, I decided to use &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt;.
&lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt; is a &lt;strong&gt;t&lt;/strong&gt;terminal &lt;strong&gt;mu&lt;/strong&gt;ltiple&lt;strong&gt;x&lt;/strong&gt;er.
This allows you to run a terminal session, then detach fromc it while it still runs in the background.&lt;/p&gt;
&lt;p&gt;This is very valuable when running command line applications that need to have an active console connection, like a Minecraft server.&lt;/p&gt;
&lt;p&gt;So first I looked at the &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt; command &lt;code class=&quot;highlighter-rouge&quot;&gt;send-keys&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&quot;send-keys&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;send-keys&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;send-keys&lt;/code&gt; allows you to send text, and key presses to a &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt; session.
Now assuming this &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt; session is attached to a Minecraft server,
there is no reason you could not run a command like this:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ tmux send-keys &quot;tell @a This is a Test&quot; Enter
&lt;/pre&gt;
&lt;p&gt;This will send the text “tell @a This is a Test” to the Minecraft server.
Then, it will hit the newline character, this will execute the command.&lt;/p&gt;
&lt;p&gt;So now we can send information to the server and have it tell the users something.&lt;/p&gt;
&lt;p&gt;But how do we get information about who is typing what in the Minecraft chat?&lt;/p&gt;
&lt;h3 id=&quot;tmuxs-capture-pane-is-painful&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt;s &lt;code class=&quot;highlighter-rouge&quot;&gt;capture-pane&lt;/code&gt; is painful&lt;/h3&gt;
&lt;p&gt;So in the manual page for &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux&lt;/code&gt; I can see a section recorded below for options I can give to the &lt;code class=&quot;highlighter-rouge&quot;&gt;capture-pane&lt;/code&gt; subcommand.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
-S and -E specify the starting and ending line numbers,
zero is the first line of the visible pane and negative
numbers are lines in the history. - to -S is the start
of the history and to -E the end of the visible pane. The
default is to capture only the visible contents of the pane.
&lt;/pre&gt;
&lt;p&gt;What it seems to be saying is I can start at line &lt;code class=&quot;highlighter-rouge&quot;&gt;-S n&lt;/code&gt; and end at line &lt;code class=&quot;highlighter-rouge&quot;&gt;-E n&lt;/code&gt;.
Negative numbers start from the bottom, so &lt;em&gt;in theory&lt;/em&gt; I can do the following: &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux capture-pane -S -1&lt;/code&gt; should capture only the last line, because Im starting from the last line. Right?&lt;/p&gt;
&lt;p&gt;No. It just doesnt work. Negative numbers do &lt;em&gt;not&lt;/em&gt; work with the &lt;code class=&quot;highlighter-rouge&quot;&gt;tmux capture-pane&lt;/code&gt; subcommand.&lt;/p&gt;
&lt;p&gt;So I did some simple UNIX piping, like so, to get just the last thing in the chat.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ tmux capture-pane -p -t steve | tail -n1
[SERVER] [ExtraDebuggingInfoHere]: &amp;lt;TaterTheTot&amp;gt; MY_MESSAGE
&lt;/pre&gt;
&lt;p&gt;TaterTheTot is my Minecraft username :)&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-p&lt;/code&gt; prints the result to the terminal/stdout.&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;steve&lt;/code&gt; is the name of the tmux session Im trying to pull form.&lt;/p&gt;
&lt;p&gt;So thats done! Beauty!&lt;/p&gt;
&lt;p&gt;Now that we have that, how can we extract the username and the message from the latest line?&lt;/p&gt;
&lt;h3 id=&quot;grep&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;grep&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;grep&lt;/code&gt; is a command to find patterns of text.
&lt;code class=&quot;highlighter-rouge&quot;&gt;grep&lt;/code&gt; has an option to only show a matching pattern of text.
This option is &lt;code class=&quot;highlighter-rouge&quot;&gt;-o&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Lets see how we can use this in conjunction with our latest line of server output to get our results.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ echo &quot;[DEBUG] [SERVER] blah blah: &amp;lt;TaterTheTot&amp;gt; MY_MESAGE&quot; | grep -o &quot;&amp;lt;.&amp;ast;&amp;gt;&quot;
&amp;lt;TaterTheTot&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Now, thats my name with the &amp;lt; and &amp;gt; attached. Not bad!
We can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;sed&lt;/code&gt; command to clean it up a bit.&lt;/p&gt;
&lt;p&gt;The syntax is like so: &lt;code class=&quot;highlighter-rouge&quot;&gt;select/somepattern/replacewith/global&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So the following command is: &lt;code class=&quot;highlighter-rouge&quot;&gt;s/[&amp;lt;&amp;gt;]//g&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Select any characters that are either &amp;lt; or &amp;gt;.
Replace with nothing.
Do so globally (as in, dont stop after you replace only one character).&lt;/p&gt;
&lt;p&gt;Take two!&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ echo &quot;[DEBUG] [SERVER] blah blah: &amp;lt;TaterTheTot&amp;gt; MY_MESAGE&quot; | grep -o &quot;&amp;lt;.&amp;ast;&amp;gt;&quot; | sed 's/[&amp;lt;&amp;gt;]//g'
TaterTheTot
&lt;/pre&gt;
&lt;p&gt;Beautiful!&lt;/p&gt;
&lt;p&gt;Now what about that pesky message?&lt;/p&gt;
&lt;h3 id=&quot;more-grep-more-sed&quot;&gt;more &lt;code class=&quot;highlighter-rouge&quot;&gt;grep&lt;/code&gt;; more &lt;code class=&quot;highlighter-rouge&quot;&gt;sed&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Simple: capture everything after the &amp;gt;. Leaving the users message entirely in tact.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ echo &quot;[DEBUG] [SERVER] blah blah: &amp;lt;TaterTheTot&amp;gt; MY_MESAGE&quot; | grep -o &quot;&amp;gt;.&amp;ast;$&quot; | sed 's/&amp;gt; //'
MY_MESSAGE
&lt;/pre&gt;
&lt;p&gt;So now we have a way to get the username of someone typing in the Minecraft server chat.
We have a way to find out what they said.
And, we have a way to respond.&lt;/p&gt;
&lt;p&gt;You can imagine how these might go together for your own use case.&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;This shows some pretty fun stuff you can do with a few simple Linux commands and a Minecraft server.&lt;/p&gt;
&lt;p&gt;I hope you learned something and found my explanations not horrific haha!&lt;/p&gt;
&lt;p&gt;Remember to checkout the git repository to see what I did with it: &lt;a href=&quot;https://github.com/TTWNO/termcraft&quot;&gt;https://github.com/TTWNO/termcraft&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;</content><author><name></name></author><summary type="html">So recently I had problem. I run a Minecraft server on a big Linux computer I have running in my room. Now, as a system administrator it is very helpful to be able to run some simple commands without needing to login with my key, password, TFA, etc. It is, frankly, a lot of work. Especially when I really just want to be playing games but I just need to check something quickly.</summary></entry><entry><title type="html">Site Update</title><link href="http://localhost:4000/2020/06/04/site-update.html" rel="alternate" type="text/html" title="Site Update" /><published>2020-06-04T00:00:00+00:00</published><updated>2020-06-04T00:00:00+00:00</updated><id>http://localhost:4000/2020/06/04/site-update</id><content type="html" xml:base="http://localhost:4000/2020/06/04/site-update.html">&lt;p&gt;I updated the site with some easier to identify information about me and my projects :)&lt;/p&gt;
&lt;p&gt;Also, Clue has been delayed due to my partner in crime on the project wokring too many hours.&lt;/p&gt;
&lt;p&gt;I also posted a new project called &lt;em&gt;&lt;a href=&quot;https://github.com/TTWNO/caesar-cipher&quot;&gt;Caesar Cipher&lt;/a&gt;&lt;/em&gt; in C. It will be an intermediate example of how to use build systems like &lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt;.&lt;/p&gt;</content><author><name></name></author><summary type="html">I updated the site with some easier to identify information about me and my projects :)</summary></entry><entry><title type="html">New Game: Clue (coming soon)</title><link href="http://localhost:4000/2020/05/19/clue-announcement.html" rel="alternate" type="text/html" title="New Game: Clue (coming soon)" /><published>2020-05-19T00:00:00+00:00</published><updated>2020-05-19T00:00:00+00:00</updated><id>http://localhost:4000/2020/05/19/clue-announcement</id><content type="html" xml:base="http://localhost:4000/2020/05/19/clue-announcement.html">&lt;p&gt;Ooo! Exciting!
Today I want to announce a new project Ill be working on which should be live within the month of May:
Clue.&lt;/p&gt;
&lt;p&gt;The original board game, implemented in an accessible format via the web.&lt;/p&gt;
&lt;p&gt;It uses a Node.js backend and standard Javascript/HTML frontend.
Nothing fancy.&lt;/p&gt;
&lt;p&gt;All the code will be hosted here: &lt;a href=&quot;https://github.com/TTWNO/clue&quot;&gt;https://github.com/TTWNO/clue&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It will be licensed under the BSD-3 license, meaning it can be used for any reason—even commercially and without source-code disclosure—without prior authorization, but it &lt;em&gt;must&lt;/em&gt; acknowledge that I helped build the end product.&lt;/p&gt;
&lt;p&gt;Once the project is live, it will be located at: &lt;a href=&quot;&quot;&gt;Lame Games&lt;/a&gt; (currently a dead link).&lt;/p&gt;</content><author><name></name></author><summary type="html">Ooo! Exciting! Today I want to announce a new project Ill be working on which should be live within the month of May: Clue.</summary></entry><entry><title type="html">How to use NGINX as a reverse-proxy server for a Node.js application using socket.io</title><link href="http://localhost:4000/2020/05/01/nginx-socket-io-projects.html" rel="alternate" type="text/html" title="How to use NGINX as a reverse-proxy server for a Node.js application using socket.io" /><published>2020-05-01T00:00:00+00:00</published><updated>2020-05-01T00:00:00+00:00</updated><id>http://localhost:4000/2020/05/01/nginx-socket-io-projects</id><content type="html" xml:base="http://localhost:4000/2020/05/01/nginx-socket-io-projects.html">&lt;p&gt;Despite the long name of the article, I have a feeling this may apply to more people than I might think.
If you have a Node.js application which needs socket.io connections that you want to pass throgh nginxs &lt;code class=&quot;highlighter-rouge&quot;&gt;reverse_proxy&lt;/code&gt; directive then this is the article for you!&lt;/p&gt;
&lt;p&gt;You &lt;em&gt;must&lt;/em&gt; seperate the socket.io sockets and the static resources.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The socket connections can be routed through the default &lt;code class=&quot;highlighter-rouge&quot;&gt;$host/socket.io&lt;/code&gt; if you want to ease modifications to the source code.&lt;/li&gt;
&lt;li&gt;The connections to your main npm Node.js application can be routed through the relevant directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the relevant part of my &lt;code class=&quot;highlighter-rouge&quot;&gt;projects.tait.tech.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
location /socket.io {
proxy_pass http://localhost:8080/socket.io/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection &quot;upgrade&quot;;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /ttrpg {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
&lt;/pre&gt;
&lt;h3 id=&quot;explaination&quot;&gt;Explaination:&lt;/h3&gt;
&lt;p&gt;For this application,
I needed the &lt;code class=&quot;highlighter-rouge&quot;&gt;/ttrpg&lt;/code&gt; directory to connect to my main Node.js instance. This was going to be the root of a ttrpg project.
It was to have static files served form my Node.js application.&lt;/p&gt;
&lt;p&gt;I also needed &lt;code class=&quot;highlighter-rouge&quot;&gt;/socket.io&lt;/code&gt; to conenct to my running &lt;code class=&quot;highlighter-rouge&quot;&gt;npm&lt;/code&gt; instance.
When I tried to route all the traffic through the &lt;code class=&quot;highlighter-rouge&quot;&gt;/trrpg&lt;/code&gt; location directive
I had no luck whatsoever;
&lt;code class=&quot;highlighter-rouge&quot;&gt;$host/ttrpg/socket.io/*&lt;/code&gt; calls &lt;em&gt;always&lt;/em&gt; failed with a 404.&lt;/p&gt;
&lt;p&gt;Having two seperate blocks forwarding in different ways seems to fix this.
I am not knowledgable enough to understand how.&lt;/p&gt;
&lt;p&gt;For now, the project is alive!!!&lt;/p&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;P.S. I forgot to mention I also symbolically linked the &lt;code class=&quot;highlighter-rouge&quot;&gt;socket.io.js&lt;/code&gt; file (that node is supposed to serve automatically) to the static client dir.
For some reson the node instance would not serve this file without that.&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ pwd
/home/user/ttrpg.co/client
$ ln -s ../server/node_modules/socket.io-client/dist/socket.io.js .
&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Happy hacking 2.0!&lt;/em&gt;&lt;/p&gt;</content><author><name></name></author><summary type="html">Despite the long name of the article, I have a feeling this may apply to more people than I might think. If you have a Node.js application which needs socket.io connections that you want to pass throgh nginxs reverse_proxy directive then this is the article for you!</summary></entry><entry><title type="html">What is XSS?</title><link href="http://localhost:4000/2020/04/25/xss.html" rel="alternate" type="text/html" title="What is XSS?" /><published>2020-04-25T00:00:00+00:00</published><updated>2020-04-25T00:00:00+00:00</updated><id>http://localhost:4000/2020/04/25/xss</id><content type="html" xml:base="http://localhost:4000/2020/04/25/xss.html">&lt;p&gt;I found a cross-site scripting (XSS) attack
in a well-known quiz hosting website.
I disclosed the vulnerability to them years ago, so I thought
now might be a good time to write about it.&lt;/p&gt;
&lt;p&gt;In this first article I will explain what XSS is.&lt;/p&gt;
&lt;p&gt;In the next article I will explain how I found this attack.&lt;/p&gt;
&lt;h2 id=&quot;what-is-cross-site-scripting-xss&quot;&gt;What is cross-site scripting (XSS)&lt;/h2&gt;
&lt;p&gt;Cross-site scripting, XSS for short,
is a technique to execute arbitrary Javascript code on a user visiting a website
by linking to Javascript code stored on another server.&lt;/p&gt;
&lt;p&gt;So for example:&lt;/p&gt;
&lt;p&gt;I have a file on my website called &lt;a href=&quot;/assets/js/hacked.js&quot;&gt;hacked.js&lt;/a&gt;.
If I was able to run this javascript file on anybody visiting a certain website &lt;em&gt;that is not mine&lt;/em&gt;, this would be called cross-site scripting.&lt;/p&gt;
&lt;p&gt;Click the above &lt;code class=&quot;highlighter-rouge&quot;&gt;hacked.js&lt;/code&gt; link to view the code I use to “hack” this website.
Its safe, I promise ;)&lt;/p&gt;
&lt;p&gt;Now, how can we get this code to execute when a user visits this site?
To explain, I will start with some of the underlying technologies.&lt;/p&gt;
&lt;h3 id=&quot;escape-characters&quot;&gt;Escape Characters!&lt;/h3&gt;
&lt;p&gt;No, this is not a Sherlock Holmes novel!&lt;/p&gt;
&lt;p&gt;If we suppose that a website is built with sequences like these (called “tags”):
&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;p&amp;gt;&lt;/code&gt; (for paragraph), &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;link&amp;gt;&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;b&amp;gt;&lt;/code&gt; for bold,
then why can you &lt;em&gt;see&lt;/em&gt; the left and right angle bracket characters?
Dont they mean something? Shouldnt they be telling the browser:
&lt;em&gt;“Hey! Make me bold!”?&lt;/em&gt;
Why &lt;em&gt;doesnt&lt;/em&gt; everything after me typing &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;b&amp;gt;&lt;/code&gt; turn bold?&lt;/p&gt;
&lt;p&gt;The answer is:&lt;/p&gt;
&lt;p&gt;There are special characters in HTML to type a visible left (&amp;lt;)
and visible right angle bracket (&amp;gt;) in a website.
If I use the left and right brackets on my keyboard however,
things will indeed &lt;b&gt;show up bold&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;This is the code for the sentence I wrote above:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
There are special characters in HTML to type a visible left (&amp;amp;lt;)
and visible right angle bracket (&amp;amp;gt;) in a website.
If I use the left and right brackets on my keyboard however,
things will indeed &amp;lt;b&amp;gt;show up bold&amp;lt;/b&amp;gt;.
&lt;/pre&gt;
&lt;p&gt;Notice how all visible left angle brackets use an &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;lt;&lt;/code&gt; to show them?&lt;/p&gt;
&lt;p&gt;These are called &lt;a href=&quot;https://en.wikipedia.org/wiki/Escape_character&quot;&gt;escape characters&lt;/a&gt;.
They tell a system, in this case your web browser:
&lt;em&gt;“Hello! Please show me off! I dont want to be hidden.”&lt;/em&gt;&lt;/p&gt;
&lt;h4 id=&quot;sanitization&quot;&gt;Sanitization&lt;/h4&gt;
&lt;p&gt;Most of the time XSS attacks are done using poorly sanitized HTML &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;
&lt;p&gt;Sanitization is when a program (usually on the server side),
will remove characters like &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;&lt;/code&gt; and replace them with the aforementioned “escape characters”.
Internally this would be something like &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;lt;&lt;/code&gt;,
but they would show up to a user as &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When inputs are not properly sanitized &lt;em&gt;and&lt;/em&gt; the input is shown to the user in another part of the website,
then a malicous user can type in HTML that will run whenever anybody tries to look at what they typed.
For example: a name for a quiz website (input) and the leaderboard for said quiz (display).&lt;/p&gt;
&lt;p&gt;HTML, by itself is not very dangerous.
The worst thing you could do is probably put a link on your name,
and then point it to a porn site.
Make your name bold, italic. Maybe make the background a funny color.
Although this may annoy your victim it is not dangerous security wise.&lt;/p&gt;
&lt;p&gt;There is one tag however, that &lt;em&gt;is&lt;/em&gt; scary…&lt;/p&gt;
&lt;h2 id=&quot;script&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;script&amp;gt;&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag allows you to write code that can:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change the page contents.&lt;/li&gt;
&lt;li&gt;Redirect the user to a new page automatically.&lt;/li&gt;
&lt;li&gt;Get a users location.&lt;/li&gt;
&lt;li&gt;Open a users microphone/webcam.&lt;/li&gt;
&lt;li&gt;With the &lt;code class=&quot;highlighter-rouge&quot;&gt;src&lt;/code&gt; &lt;a href=&quot;https://www.w3schools.com/htmL/html_attributes.asp&quot;&gt;attribute&lt;/a&gt; you can also load a script from another site. (This is XSS)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Those last two will ask for permission from the user (if their browser isnt insanely insecure).&lt;/p&gt;
&lt;p&gt;In my next article Ill talk about a website I found which is vulnerable to this attack.
And, show you how you can run your own XSS attack.&lt;/p&gt;</content><author><name></name></author><summary type="html">I found a cross-site scripting (XSS) attack in a well-known quiz hosting website. I disclosed the vulnerability to them years ago, so I thought now might be a good time to write about it.</summary></entry><entry><title type="html">rfi: A Simple Linux utility to get a random file from a directory</title><link href="http://localhost:4000/2020/04/21/rfi.html" rel="alternate" type="text/html" title="rfi: A Simple Linux utility to get a random file from a directory" /><published>2020-04-21T00:00:00+00:00</published><updated>2020-04-21T00:00:00+00:00</updated><id>http://localhost:4000/2020/04/21/rfi</id><content type="html" xml:base="http://localhost:4000/2020/04/21/rfi.html">&lt;p&gt;I made a &lt;a href=&quot;https://lbry.tv/@tait:7/rfi:5&quot;&gt;little video&lt;/a&gt; about this script I wrote:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ rfi
&lt;/pre&gt;
&lt;p&gt;This program gets a random file from your current directory
if you do not specify one;
it gets a random file from the specified directory if you give it one like so:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
# rfi /etc/wireguard
&lt;/pre&gt;
&lt;p&gt;Which is very useful if you want to start a random VPN configuration :)&lt;/p&gt;
&lt;p&gt;The code, comments, etc. are on the &lt;a href=&quot;https://github.com/TTWNO/scripts&quot;&gt;Github&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><summary type="html">I made a little video about this script I wrote:</summary></entry><entry><title type="html">NAS Part 1: Theorize</title><link href="http://localhost:4000/2020/04/12/nas1.html" rel="alternate" type="text/html" title="NAS Part 1: Theorize" /><published>2020-04-12T00:00:00+00:00</published><updated>2020-04-12T00:00:00+00:00</updated><id>http://localhost:4000/2020/04/12/nas1</id><content type="html" xml:base="http://localhost:4000/2020/04/12/nas1.html">&lt;p&gt;New Project, phase one:
Theorize.&lt;/p&gt;
&lt;p&gt;I want to build a NAS server to store a bunch of data on. Current problem is lack of a computer to accept multiple SATA connections.&lt;/p&gt;
&lt;h3 id=&quot;problem-1-sata-connectors&quot;&gt;Problem 1: SATA connectors&lt;/h3&gt;
&lt;p&gt;This can be solved by an HBE card. Although they tend to be quite expensive (250+).
One decent model that isnt that much is the &lt;a href=&quot;https://www.amazon.ca/SAS9211-8I-8PORT-Int-Sata-Pcie/dp/B002RL8I7M/ref=sr_1_2?keywords=9211-8i&amp;amp;qid=1586699707&amp;amp;sr=8-2&quot;&gt;LSI 9211-8I&lt;/a&gt;.
This is ideal for future expansion.&lt;/p&gt;
&lt;p&gt;A cheaper option is a PCIe multi-SATA connector &lt;a href=&quot;https://www.amazon.ca/Rivo-Controller-Expansion-Profile-Non-Raid/dp/B0836MKFCR?ref_=ast_slp_dp&quot;&gt;like this&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Either work, but one is cheaper and the other is more expandable.
The 9211-8I uses two SAS ports, which can be expanded indefinetely. SAS supports splitting.
SATA can be connected in a 4:1 ratio to SAS connectors with some &lt;a href=&quot;https://www.amazon.com/Cable-Matters-Internal-SFF-8087-Breakout/dp/B012BPLYJC&quot;&gt;cheap cables&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;problem-2-drives&quot;&gt;Problem 2: Drives&lt;/h3&gt;
&lt;p&gt;I do not have enough drives to make this work right now.
For the setup I want it would require 5 or 6 drives.
I will get 4-5 drives worth of space as one drive worth of space is dedicated to “parity”, making you able to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify data integrity. If anything goes wrong with a write, it will be fixed automatically.&lt;/li&gt;
&lt;li&gt;If &lt;em&gt;one&lt;/em&gt; drive dies, the system can stay online with no problem. Two drives and Im eff-you-see-kay-ed-dee.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;My other option is to use two drives worth of space for partiy.
This would only have me 3-4 drives of space, but
this system can withstand the failure of &lt;em&gt;two&lt;/em&gt; drives.&lt;/p&gt;
&lt;h3 id=&quot;problem-3-computer-system&quot;&gt;Problem 3: Computer System&lt;/h3&gt;
&lt;p&gt;I currently have 5 computers.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Celery Stick. An old grey HP laptop with a Braille stickered keyboard. &lt;em&gt;Does not work right now; bad thermal paste job.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;A Dell laptop lent to me by my school during my studies.&lt;/li&gt;
&lt;li&gt;Houston. A 21-inch 2011 iMac for which the screen does not work under Linux (excep with the &lt;code class=&quot;highlighter-rouge&quot;&gt;nomodeset&lt;/code&gt; kernel option enabled).&lt;/li&gt;
&lt;li&gt;An Old Toshiba laptop (circa 2010) that I got for $50 to test with OpenBSD (works….sometimes).&lt;/li&gt;
&lt;li&gt;Main Rig. My main laptop is an ASUS-705 TUF gaming laptop.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;None of these have PCIe expansion slots with a case that can handle the new drives.&lt;/p&gt;
&lt;p&gt;I think its reasonable to say that for hard-drives and low-end tower PCs,
I will likely have luck on a place like &lt;a href=&quot;https://kijiji.ca&quot;&gt;Kijiji&lt;/a&gt; (Canadian Craigslist).&lt;/p&gt;
&lt;p&gt;The search continues :)&lt;/p&gt;
&lt;p&gt;Im in for a fun ride…. and a few monnies.&lt;/p&gt;</content><author><name></name></author><summary type="html">New Project, phase one: Theorize.</summary></entry><entry><title type="html">How To Encrypt Your Own Documents Using gpg</title><link href="http://localhost:4000/2020/04/06/rsa4.html" rel="alternate" type="text/html" title="How To Encrypt Your Own Documents Using gpg" /><published>2020-04-06T00:00:00+00:00</published><updated>2020-04-06T00:00:00+00:00</updated><id>http://localhost:4000/2020/04/06/rsa4</id><content type="html" xml:base="http://localhost:4000/2020/04/06/rsa4.html">&lt;p&gt;If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you!
It should be noted that in some circles the tools used are more common than in others.
These are the everyday tools of many privacy advocates and computer nerds.&lt;/p&gt;
&lt;p&gt;If you have never used Linux however, then the method of doing this will be rather unfamiliar.
This tutorial will be done on an &lt;a href=&quot;https://archlinux.org/&quot;&gt;Arch Linux&lt;/a&gt; machine,
but it should be the same on Ubuntu, Fedora, CentOS, Debian,
OpenBSD, FreeBSD, MacOSX, etc.
The only operating system that does not include these tools by default (or easily accessible) is Windows.&lt;/p&gt;
&lt;p&gt;This tutorial makes heavy use of the terminal.
You have been warned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Let us…begin!&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;glossary&quot;&gt;Glossary&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor&quot;&gt;&lt;strong&gt;ASCII armour&lt;/strong&gt;&lt;/a&gt; — A way to encode &lt;strong&gt;OpenPGP&lt;/strong&gt; documents so they are readable by humans. These files end in .asc&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;(Open)PGP&lt;/strong&gt; — An open standard for encoding pulbic keys and encrypted documents.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GPG&lt;/strong&gt; — GNUPrivacyGaurd is an implementation of &lt;strong&gt;OpenPGP&lt;/strong&gt;. It is installed by default on most Linux distrobutions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;step-0-setup&quot;&gt;Step 0: Setup&lt;/h2&gt;
&lt;p&gt;We will be using the utility &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt; for this tutorial.&lt;/p&gt;
&lt;p&gt;The other thing to note: The character $ (dollar sign) is usually not typed when shown in a command.
It simply indicates that you do not need administrative privilages to run these commands.&lt;/p&gt;
&lt;p&gt;Test to see if you get this output in your terminal.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --version
gpg (GnuPG) 2.2.20
libgcrypt 1.8.5
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &amp;lt;https://gnu.org/licenses/gpl.html&amp;gt;
...
&lt;/pre&gt;
&lt;p&gt;If this is not successful look into how to install these tools on your system.&lt;/p&gt;
&lt;h2 id=&quot;step-1-getcreate-a-public-key&quot;&gt;Step 1: Get/Create A Public Key!&lt;/h2&gt;
&lt;h3 id=&quot;get-somebody-elses&quot;&gt;Get Somebody Elses&lt;/h3&gt;
&lt;p&gt;Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower.&lt;/p&gt;
&lt;p&gt;To encrypt a document with somebodys public key, you need to first obtain it.
My public key is available &lt;a href=&quot;/public-key.asc&quot;&gt;at this link&lt;/a&gt;, and you can use it to send me encrypted stuff.&lt;/p&gt;
&lt;p&gt;If you are on a linux terminal, you can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;curl&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;wget&lt;/code&gt; command to download it.&lt;/p&gt;
&lt;p&gt;wget:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ wget https://tait.tech/public-key.asc
&lt;/pre&gt;
&lt;p&gt;Curl:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ curl https://tait.tech/public-key.asc -o public-key.asc
&lt;/pre&gt;
&lt;h3 id=&quot;make-your-own-optional&quot;&gt;Make Your Own (optional)&lt;/h3&gt;
&lt;p&gt;The following section is quite long,
so if you dont want to create your own keypair,
then feel free to skip to &lt;a href=&quot;#step-2-import-public-key&quot;&gt;Step #2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want to encrypt your own documents,
or you want others to be able to send you encrypted messages,
then you can create your own public/private key pair.
You can use these to encrypt your documents,
and you can send our public key to others so that they can securely communicate with yourself.&lt;/p&gt;
&lt;p&gt;Run the following command in your terminal, and follow the steps I outline to get you started.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --full-gen-key
&lt;/pre&gt;
&lt;p&gt;This will produce the following dialog:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(14) Existing key from card
Your selection?
&lt;/pre&gt;
&lt;p&gt;Select the option &lt;code class=&quot;highlighter-rouge&quot;&gt;1&lt;/code&gt;. You want two keys, both RSA.&lt;/p&gt;
&lt;p&gt;Next we will select the key size:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
&lt;/pre&gt;
&lt;p&gt;Type the number 2048.&lt;/p&gt;
&lt;p&gt;Next it will ask you how long you want the key to be valid.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
&amp;lt;n&amp;gt; = key expires in n days
&amp;lt;n&amp;gt;w = key expires in n weeks
&amp;lt;n&amp;gt;m = key expires in n months
&amp;lt;n&amp;gt;y = key expires in n years
Key is valid for? (0)
&lt;/pre&gt;
&lt;p&gt;Type the number 1. This will enable you time to test it,
but it will make the key expire within 24 hours so that if you accidentally
share your private key, or delete your VM and no longer have access to it, you will be fine.&lt;/p&gt;
&lt;p&gt;It will ask your if you are sure about the expiry date.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
Key expires at Tue Apr 7 02:24:23 2020 UTC
Is this correct? (y/N)
&lt;/pre&gt;
&lt;p&gt;Type &lt;code class=&quot;highlighter-rouge&quot;&gt;y&lt;/code&gt; to confirm your choice.&lt;/p&gt;
&lt;p&gt;Now &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt; is going to ask you to create a user id to indetify this key.
Use some test data for now.
User input is in bold, feel free to follow along or to put your own test data in.&lt;/p&gt;
&lt;p&gt;Once you are more comfortable with the tools,
then you can create a public/private keypair that you will keep for some time.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
GnuPG needs to construct a user ID to identify your key.
Real name: &lt;b&gt;Mr. Tester&lt;/b&gt;
Email address: &lt;b&gt;test@test.org&lt;/b&gt;
Comment: &lt;b&gt;for testing only&lt;/b&gt;
You selected this USER-ID:
&quot;Mr. Tester (for testing only) &amp;lt;test@test.org&amp;gt;&quot;
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? &lt;b&gt;O&lt;/b&gt;
&lt;/pre&gt;
&lt;p&gt;It will then ask you for a password.
If you are simply using this for test purposes,
then you can feel free to set it to something like “test”.
When create a long-term use pulbic key make sure to make the password &lt;em&gt;very&lt;/em&gt; secure.&lt;/p&gt;
&lt;p&gt;During the process of creating your key, &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt; may warn you with this message:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
&lt;/pre&gt;
&lt;p&gt;If this happens, feel free to smash your keyboard (lightly),
watch a YouTube video on the machine,
browse the web with &lt;a href=&quot;http://w3m.sourceforge.net/&quot;&gt;w3m&lt;/a&gt;,
etc. until the key is generated.&lt;/p&gt;
&lt;p&gt;You will know it is done when you see this message (or something similar):&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
gpg: key EACCC490291EA7CE marked as ultimately trusted
gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
public and secret key created and signed.
pub rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
FFA7D7525C6546983F1152D8EACCC490291EA7CE
uid Mr. Tester (for testing only) &amp;lt;test@test.org&amp;gt;
sub rsa2048 2020-04-06 [E] [expires: 2020-04-07]
&lt;/pre&gt;
&lt;p&gt;Tada! You have your own public/private keypair!&lt;/p&gt;
&lt;p&gt;Sharing a keypair that will expire soon is not a good idea,
however, if you are ready, then you can use this command to generate a public key file to share with others.&lt;/p&gt;
&lt;p&gt;Feel free to substitute “Mr. Tester” for any other identifying part of your key.
Remember that to use the email, you must enclose it in &amp;lt; and &amp;gt;.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --export --armour &quot;Mr. Tester&quot; &amp;gt; public-key.asc
&lt;/pre&gt;
&lt;p&gt;To use the email as the identifier:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --export --armour &quot;&amp;lt;test@test.org&amp;gt;&quot; &amp;gt; public-key.asc
&lt;/pre&gt;
&lt;h2 id=&quot;step-2-import-public-key&quot;&gt;Step 2: Import Public Key&lt;/h2&gt;
&lt;p&gt;This list of keys that &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt; keeps on tap so to speak, is called our “keyring”.
Your will need to import a new public key to encrypt files with &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :)&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&quot;/assets/img/keyring.jpg&quot; alt=&quot;A keyring holding eight allen keys.&quot; /&gt;
&lt;figcaption&gt;
A keyring holding eight allen keys.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To import a public key to use for encrypting files, use the &lt;code class=&quot;highlighter-rouge&quot;&gt;--import&lt;/code&gt; option of &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt;. Like so:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --import public-key.asc
gpg: key 64FB4E386953BEAD: public key &quot;Tait Hoyem &amp;lt;tait.hoyem@protonmail.com&amp;gt;&quot; imported
gpg: Total number processed: 1
gpg: imported: 1
&lt;/pre&gt;
&lt;p&gt;Now that we have imported a public key, we can make a message to send!&lt;/p&gt;
&lt;h2 id=&quot;step-3-have-a-message-to-encrypt&quot;&gt;Step 3: Have A Message To Encrypt&lt;/h2&gt;
&lt;p&gt;You can make a new file which holds some important, secret data.
Feel free to use a graphical editor if you have one, if not, &lt;code class=&quot;highlighter-rouge&quot;&gt;nano&lt;/code&gt; works alright too.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
Rules Of A Good Life:
1. Wash your hands!
2. Work hard!
3. Be firm.
5. Have good friends!
&lt;/pre&gt;
&lt;p&gt;Save this file as something like &lt;code class=&quot;highlighter-rouge&quot;&gt;test-pgp.txt&lt;/code&gt;, and well use that name later.&lt;/p&gt;
&lt;h2 id=&quot;step-4-encrypt-a-message&quot;&gt;Step 4: Encrypt A Message&lt;/h2&gt;
&lt;p&gt;Now that we have a message to send and person to send to,
all we have to do is encrypt this message and itll be on its merry way!
To do so, we must specify two new options to &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The first is &lt;code class=&quot;highlighter-rouge&quot;&gt;--recipient&lt;/code&gt;.
This tells &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg&lt;/code&gt; to encrypt using a certin public key that we have in our keyring.
You can use the persons name, email address, or the keys uid.&lt;/p&gt;
&lt;p&gt;The second is &lt;code class=&quot;highlighter-rouge&quot;&gt;--encrypt&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You will also specify the &lt;code class=&quot;highlighter-rouge&quot;&gt;--armour&lt;/code&gt; option to use ASCII armoured files. Put this option after &lt;code class=&quot;highlighter-rouge&quot;&gt;--encrypt&lt;/code&gt;, and put the file name after &lt;code class=&quot;highlighter-rouge&quot;&gt;--armour&lt;/code&gt;. See below.&lt;/p&gt;
&lt;p&gt;You can either use your own public key name to encrypt a document (allowng only you to decrypt it),
or you can use my public key that we imported earlier (allowing only me to decrypt it).
Either way works fine.&lt;/p&gt;
&lt;p&gt;This is the big one!&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --recipient &quot;Tait Hoyem&quot; --encrypt --armour test-gpg.txt
&lt;/pre&gt;
&lt;p&gt;“But there is no output!” you might say!
Yes, that is because our new (encrypted) file has already been saved.
Lets look at it with cat.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ cat test-gpg.txt.asc
-----BEGIN PGP MESSAGE-----
hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
nv117moLfK22Mst/
=bw8T
-----END PGP MESSAGE-----
&lt;/pre&gt;
&lt;h2 id=&quot;step-5-decryption-optional&quot;&gt;Step 5: Decryption (optional)&lt;/h2&gt;
&lt;p&gt;If you created your own public/private keypair in step 1,
and you encryped using &lt;code class=&quot;highlighter-rouge&quot;&gt;--recipient &quot;Your Test Name&quot;&lt;/code&gt;,
then you can decrypt your document as well!&lt;/p&gt;
&lt;p&gt;You will need to specify &lt;code class=&quot;highlighter-rouge&quot;&gt;--decrypt&lt;/code&gt;, and thats all folks!&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
$ gpg --decrypt test-gpg.txt.asc
&lt;/pre&gt;
&lt;p&gt;A password dialog will then come up asking for your previously created password.
As long as you remember your password from before and enter it correctly: voila!&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;
gpg: encrypted with 4096-bit RSA key, ID 6989B986FCBE4225, created 2020-01-02
&quot;Tait Hoyem &amp;lt;tait.hoyem@protonmail.com&amp;gt;&quot;
Rules Of A Good Life:
1. Wash your hands!
2. Work hard!
3. Be firm.
5. Have good friends!
&lt;/pre&gt;
&lt;h2 id=&quot;step-6-finale&quot;&gt;Step 6: Finale!&lt;/h2&gt;
&lt;p&gt;Ladies and gentleman, you have done it!
You have encrypted our very own document.
(And maybe even decrypted it yourself too :)&lt;/p&gt;
&lt;p&gt;If you encrypted using my public key,
feel free to send it to &lt;a href=&quot;mailto:tait@tait.tech&quot;&gt;my email&lt;/a&gt;.
I am happy to verify if it worked.&lt;/p&gt;
&lt;p&gt;For more information on this subject, check out &lt;a href=&quot;https://www.gnupg.org/gph/en/manual/c14.html&quot;&gt;gnugp.orgs guide&lt;/a&gt; on using GPG.
They are the ones that make these tools available,
and the &lt;a href=&quot;https://www.gnu.org/&quot;&gt;GNU Project&lt;/a&gt; has been instrumental in creating the open-source world as it exists today.
Give em some love, eh!&lt;/p&gt;
&lt;p&gt;Thank you so much for sticking through this whole thing!
Let me know if there is anything that doesnt make sense.
I am happy to improve this guide as time goes on if that is necessary.&lt;/p&gt;
&lt;p&gt;Happy hacking :)&lt;/p&gt;</content><author><name>tait</name></author><summary type="html">If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! It should be noted that in some circles the tools used are more common than in others. These are the everyday tools of many privacy advocates and computer nerds.</summary></entry><entry><title type="html">How Asymetric Encryption Works</title><link href="http://localhost:4000/2020/04/02/rsa3.html" rel="alternate" type="text/html" title="How Asymetric Encryption Works" /><published>2020-04-02T00:00:00+00:00</published><updated>2020-04-02T00:00:00+00:00</updated><id>http://localhost:4000/2020/04/02/rsa3</id><content type="html" xml:base="http://localhost:4000/2020/04/02/rsa3.html">&lt;p&gt;In a few previous articles I have explained &lt;a href=&quot;/2020/01/26/rsa1.html&quot;&gt;why encryption may be important to you&lt;/a&gt; and &lt;a href=&quot;/2020/02/19/rsa2.html&quot;&gt;how the theory behind encryption works&lt;/a&gt;. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.&lt;/p&gt;
&lt;p&gt;Previously, we talked about how &lt;em&gt;symetric&lt;/em&gt; encryption works. This is by having a shared key that both parties use to simultaniously encrypt, and decrypt the data. (See Ceasar Cipher for example).&lt;/p&gt;
&lt;h2 id=&quot;public-key-or-asymetric-encryption&quot;&gt;Public-key, or Asymetric Encryption&lt;/h2&gt;
&lt;p&gt;Asymetric encryption is based on the idea of having multiple keys instead of only one shared key.
For example: instead of encrypting with one key, and decrypting with that same key (like our ROT ciphers we talked about previously), we can use one key to &lt;em&gt;encrypt&lt;/em&gt; the information, and a different key to &lt;em&gt;decrypt&lt;/em&gt; the information.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&quot;/assets/img/alice-to-bob.png&quot; alt=&quot;Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key.&quot; /&gt;
&lt;figcaption&gt;
Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In the picture above, see how Alice uses Bobs public key to encrypt some data,
then sends it to Bob for him to decrypt with his private key?
That is the essense of public-key encryption.&lt;/p&gt;
&lt;p&gt;The great thing about public-key encryption is that your public key is &lt;em&gt;public&lt;/em&gt;! There is no need to be afraid of sending this everywhere!
You can attach it at the end of all your emails, the end of your forum posts, &lt;a href=&quot;/public-key.asc&quot;&gt;a link to it on your low-power webserver&lt;/a&gt; (wink).
There are even things called &lt;a href=&quot;http://keys.gnupg.net/&quot;&gt;keyservers&lt;/a&gt; that will save your public key on them for retrival in case somebody wants to verify your public key.&lt;/p&gt;
&lt;p&gt;Anything encrypted with your public key can only be decrypted with your private key.
Provided you never, &lt;em&gt;NEVER&lt;/em&gt; share your private key with anyone ever, we can assume that all messages sent to you encrypted with your public key will never be read by anyone else.&lt;/p&gt;
&lt;p&gt;Asymetric encryption, however, often contains four keys instead of two. Why is this?&lt;/p&gt;
&lt;h4 id=&quot;verification-of-author&quot;&gt;Verification of Author&lt;/h4&gt;
&lt;p&gt;One interesting thing about keys pairs is that not only can the private key decrypt anything the public key encrypts,
but the public key can decrypt anything the private key encrypts.&lt;/p&gt;
&lt;p&gt;Now why would one want to encrypt a message that can be decrypted by anyone?&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&quot;/assets/img/alice-sign-to-bob.png&quot; alt=&quot;Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it!&quot; /&gt;
&lt;figcaption&gt;
Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it!
&lt;br /&gt;
&lt;br /&gt;
Note: Although the picture shows otherwise, the text is not sent in the plain. It is encrypted with Alice's private key.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is how you can verify that the person who says they wrote the message really did indeed write the message!
If their private key was never shared with anyone else, then the message must have come from them!&lt;/p&gt;
&lt;p&gt;For maximum security, these methods are often layered.
First, signing with the senders private key,
ensuring only they could have sent it—
then encrypted with the recipients pulbic key,
making sure only the reciever can read it.&lt;/p&gt;
&lt;p&gt;Note that both sides must first have eachothers public keys to do this.
This is easy if they communicate often, but when first contacting somebody,
people will generally send their encrypted message along with the their own pulbic key attached in a seperate file.&lt;/p&gt;
&lt;h3 id=&quot;what-this-means&quot;&gt;What This Means&lt;/h3&gt;
&lt;p&gt;Notice neither Alice nor Bob had to share any comprimsing information over the network?
This is why public-key encryption is so powerful!&lt;/p&gt;
&lt;p&gt;Alice and Bob can both safely send their public keys in the open.
They can even send them over the insecure HTTP, or FTP protocols.&lt;/p&gt;
&lt;p&gt;Whilst not sending any encryption-breaking messages,
Alice and Bob now have a way to communicate securely.
If you trust nothing and no one, this is your perfered method of security.&lt;/p&gt;
&lt;p&gt;Check out this &lt;a href=&quot;https://www.youtube.com/watch?v=GSIDS_lvRv4&quot;&gt;Computerphile video&lt;/a&gt; if you want the simplified explaination.&lt;/p&gt;
&lt;h3 id=&quot;the-algorithms&quot;&gt;The Algorithms&lt;/h3&gt;
&lt;p&gt;The two biggest “implementations” of public-key cryptography vary only in the mathamatical equations used to generate the numbers,
and how the numbers are &lt;a href=&quot;https://en.wikipedia.org/wiki/Trapdoor_function&quot;&gt;“trapdoored”&lt;/a&gt; to decrypt if you have the correct key.&lt;/p&gt;
&lt;p&gt;I will discuss the differences in approach here.
If you want to skip to the next article where I show you how to encrypt your own documents using RSA, see &lt;a href=&quot;/2020/04/06/rsa4.html&quot;&gt;this link&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;rsa&quot;&gt;RSA&lt;/h3&gt;
&lt;p&gt;The mathamatic center of the RSA system was developed over the course of a year or so.
Three men were involved. Ron Rivest, Adi Shamir, and Leonard Aldeman.
They worked as a kind of “team”: Each idea by Rivest and Shamir were critisized by the mathamatician on their team: Mr. Aldeman.&lt;/p&gt;
&lt;p&gt;One night, after consuming
&lt;a href=&quot;https://www.math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALAPP/Calderbank.pdf&quot;&gt;“liberal quantities of Manischewitz wine”&lt;/a&gt;
Rivest had trouble sleeping.
After taking long gazes into the abyss of his math textbook, he came up with an idea which would change cryptography forever.
By the next morning, an academic mathamatical paper was nearly finished.
He named it after himself and the two others that had been helping him along this whole time. &lt;em&gt;Rivest, Shamir, Aldeman&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Key sizes of RSA range from 1024-bit to 4096-bit.
1024-bit keys are considered somewhat insecure.
However,
it should be noted that every bit doubles the complexity of the key,
so 2048 is &lt;a href=&quot;https://www.wolframalpha.com/input/?i=2%5E1024&quot;&gt;2^1024&lt;/a&gt; times more complex than 1024.&lt;/p&gt;
&lt;h3 id=&quot;eliptic-curve-ec&quot;&gt;Eliptic-Curve (EC)&lt;/h3&gt;
&lt;p&gt;Eliptic-Curve (EC) is a family of algorithms that use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Elliptic_curve&quot;&gt;Eliptic curve&lt;/a&gt; mathamatical structure to generate the numbers for the keys.
EC can effectivly provide the security of an RSA key &lt;a href=&quot;https://www.youtube.com/watch?v=NF1pwjL9-DE&quot;&gt;one order of magnitude larger&lt;/a&gt; than an RSA key.&lt;/p&gt;
&lt;figure&gt;
&lt;img src=&quot;/assets/img/ec.png&quot; alt=&quot;A picture of an eliptic curve.&quot; class=&quot;small-image&quot; /&gt;
&lt;figcaption&gt;
An eliptic curve structure.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Its fast; its secure! Perfect right?&lt;/p&gt;
&lt;p&gt;Of course not!&lt;/p&gt;
&lt;p&gt;One problem is that due to the smaller key size,
it can more easily be broken by brute-force.
This is why EC is mostly used for temporary communication (like HTTPS), not permenant communication (like having an encrypted email conversation with a journalist).&lt;/p&gt;
&lt;p&gt;The other problem is that a certain EC algrorithm called P-256 is suspected to be introduced with malice to National Institute of Standards and Technology (NIST)
&lt;a href=&quot;https://www.schneier.com/essays/archives/2007/11/did_nsa_put_a_secret.html&quot;&gt;by the NSA&lt;/a&gt;.
Supposedly, the NSA is able to crack anything encrypted with this algorithm.
I will let the experts argure about that.&lt;/p&gt;
&lt;p&gt;Other well-known EC algorithms that are more-or-less trusted as secure do exist though.
The premeire one being Curve25519.
The reference implementation of &lt;a href=&quot;https://cr.yp.to/ecdh.html&quot;&gt;this algrorithm&lt;/a&gt; is also &lt;a href=&quot;https://fairuse.stanford.edu/overview/public-domain/welcome/&quot;&gt;public-domain&lt;/a&gt;,
so it is easy for devlopers to work into their own applications without worrying about copywrite.&lt;/p&gt;
&lt;h2 id=&quot;conslusion&quot;&gt;Conslusion&lt;/h2&gt;
&lt;p&gt;In this article we went over some basic points:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Public-key encryption enables secure communication over insecure networks.&lt;/li&gt;
&lt;li&gt;RSA is considered the standard for extra-seure communication.&lt;/li&gt;
&lt;li&gt;EC is a newer, faster, more transient encryption method.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To learn how to use RSA keys to encrypt your own communications, check out &lt;a href=&quot;/2020/04/06/rsa4.html&quot;&gt;this other aritcle I wrote&lt;/a&gt;.&lt;/p&gt;</content><author><name>tait</name></author><summary type="html">In a few previous articles I have explained why encryption may be important to you and how the theory behind encryption works. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.</summary></entry><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, you will tend to 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 types 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 deodorant?
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;figure&gt;
&lt;img alt=&quot;A message I would have sent in middle school. ROT5: Xfwfm hx hzy&quot; src=&quot;/assets/img/ceasar1.jpg&quot; /&gt;
&lt;figcaption&gt;
The kind of message I would have sent in middle school. A ROT5 Ceasar cipher.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is a message encrypted using the Caesar cipher. This encryption technique was used by Julius Caesar during the reign of the Roman Empire to “encrypt messages 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;figure&gt;
&lt;img alt=&quot;A diagram of a Ceasar Shift algorithm. A &amp;lt;-&amp;gt; N, B &amp;lt;-&amp;gt; O, et cetera.&quot; src=&quot;/assets/img/ceasar13.png&quot; /&gt;
&lt;figcaption&gt;
A diagram of a ROT13 Ceasar shift algorithm. A &amp;lt;-&amp;gt; N, B &amp;lt;-&amp;gt; O, et cetera.
&lt;/figcaption&gt;
&lt;/figure&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;When you reach the end of the alphabet, wrap around to the beginning to find the encrypted letter.&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, young lady with feelings for Bob&lt;/li&gt;
&lt;li&gt;Bob, a young lad 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 message, 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 message, she should shift her letters seven letters forward in the alphabet—just like the example above.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt=&quot;A longer Ceasar cipher encrypted message: ROT2: Wpeng Vgf ku dqqogt ogog]&quot; src=&quot;/assets/img/ceasar2.jpg&quot; /&gt;
&lt;figcaption&gt;
A longer Ceasar cipher encrypted message using ROT2.
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Now Alices message 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 message 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 messages.
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 message in the first place.&lt;/p&gt;
&lt;h4 id=&quot;universal-vulnerability-of-messages&quot;&gt;Universal Vulnerability of Messages&lt;/h4&gt;
&lt;p&gt;Every message 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 message 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 chance 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></feed>