From c872644ffd25b35a2734c0dba53a3cb64363aa58 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 9 Sep 2019 18:10:43 -0700 Subject: [PATCH 1/7] mixed up 312/412 coursee contents we good now --- {412 => 312/notes}/1.md | 0 312/notes/crypt1.md | 75 ++++++++++++++++++++++++++++++++++++ {412 => 312/notes}/readme.md | 0 3 files changed, 75 insertions(+) rename {412 => 312/notes}/1.md (100%) create mode 100644 312/notes/crypt1.md rename {412 => 312/notes}/readme.md (100%) diff --git a/412/1.md b/312/notes/1.md similarity index 100% rename from 412/1.md rename to 312/notes/1.md diff --git a/312/notes/crypt1.md b/312/notes/crypt1.md new file mode 100644 index 0000000..d6c3bbf --- /dev/null +++ b/312/notes/crypt1.md @@ -0,0 +1,75 @@ +# Cryptography - First steps + + +## Theoretical mumbjo jumbo + +I'm going propose right now that there are two principles to _all_ cryptography: + +1. Key production +2. Algorithmic reliability + +In plain English: the two main problems we encounter when trying to safely[1] encrypt a set of data, or more generally/simply, _a thing_ is producing some kind of key that can't be reliably guess + an algorithm which can doesn't subject itself to being breakable[2]. + +## Ciphers + +_All_ ciphers work on __one__ principle: replacement of characters/things in the thing we are trying to cipher. + +Some popular forms of this + +> What is Rotational ciphering + +Let's take `abc` and increase each character by `x=2`. +We end up with `cde`. + + +> I'm a malware developer how do I cipher binary data? + +Easy, your alphabet isn't a-z or A-Z but now `0x00 - 0xff` or, if you want to use pairs of bytes your alphabet is `0x0000 - 0xffff`. +Again apply the same logic from above to the new "_alphabet_". + + +> What are Substitution Ciphers + +Let's shuffle our normal everyday alphabet from `abcde...` to `uwfcj...`. +Now we take these two : + +``` +abcde... +uwfcj... +``` + +We can now say that all the `a`'s in our _thing_ that we want to cipher gets replaced by `u`'s, `b` by `w` and so forth to the end. + +> That's perfect let's always use that! + +Except you can use some statistical magic[3] to analyze the frequency of the ciphered letters and make a better guess at what the message might be. +Also with a small character set there would be less to fuddle through, also keep in mind that cpu's operate in orders of _billions of operations a second_ which means you character set needs to be comically large to ensure a processor doesn't reverse the cipher in seconds/minutes. + +## Encryption + +> hold up isn't cipher a form of encryption? + +Yes&no. No because ciphers operate in-place as they are all just replacing things with other things, usually of the same length/shape/whatever. + +> Where is the distinction? + +We now take our _key_ and _data/thing_ and produce a new seemingly unrelated _encrypted thing_. + + +So `abc` thrown through some encryption might turn into `234123j4h1` for whatever algorithmic reason(mileage may vary depending on algorithm). + + +> What is Symmetric & asymmetric key encryption? + +Conceptual answers: + +Symmetric: One key to encrypt/decrypt or _lock/unlock_ the _thing_, just a like a typical lock on a door. + +Asymmetric: One key can encrypt/lock the _thing_(public) and one can open it(private key). +The keynote here however is that the private key should be _really hard to guess_. + +## Footnotes + +1. + +2. diff --git a/412/readme.md b/312/notes/readme.md similarity index 100% rename from 412/readme.md rename to 312/notes/readme.md From 86df5982cd10e9a755bf11f4af4925c582ee0914 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 9 Sep 2019 18:35:19 -0700 Subject: [PATCH 2/7] lel --- 334/homework/2/msh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/334/homework/2/msh.c b/334/homework/2/msh.c index 956d3de..218efb4 100644 --- a/334/homework/2/msh.c +++ b/334/homework/2/msh.c @@ -15,6 +15,9 @@ int main(void) { while(1) { printf("%s", PROMPT); fgets(buffer, MAX_BUF, stdin); + if(!strlen(buffer)) { + return 0; + } // process the input remove_newline(buffer); exit_branch(buffer); From 463be325fbedbb8d18f4e06bbe06543ab56ca4a9 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 9 Sep 2019 18:36:56 -0700 Subject: [PATCH 3/7] base notes for 412 about deployment things --- 412/hardware-strats.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 412/hardware-strats.md diff --git a/412/hardware-strats.md b/412/hardware-strats.md new file mode 100644 index 0000000..5aa2d87 --- /dev/null +++ b/412/hardware-strats.md @@ -0,0 +1,24 @@ +# Hardware deployment Strategies + + +## Virtual Desktop Interface + +aka 0-Clients: network hosted OS is what each client would use. + +In some cases that network is a pool of servers which are tapped into. +Clients can vary in specs like explained below(context: university): + +> Pool for a Library + +Clients retain low hardware specs since most are just using office applications and not much else. + +> Pool for an Engineering department + +Clients connect to another pool where both clients and pool have better hardware specs/resources. + +The downside is that there is _1 point of failure_. +The pool goes down and so does everyone else, meaning downtime is going to cost way more than a single machine going down. + + + + From 855c78358ce27218bcf2b7bfaa3af1e65a7a1b0c Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Tue, 10 Sep 2019 11:25:51 -0700 Subject: [PATCH 4/7] topics covered --- 312/notes/topics.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 312/notes/topics.md diff --git a/312/notes/topics.md b/312/notes/topics.md new file mode 100644 index 0000000..5a5e2ba --- /dev/null +++ b/312/notes/topics.md @@ -0,0 +1,10 @@ +# Things that get covered in this class + + +## Ciphers + +_Just the ones covered_: + +* _Rot Ciphers_ +* Rail fence +* Row Transposition From 0719f063da6998a51994bcf0decfc86789b79dce Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 11 Sep 2019 21:15:51 -0700 Subject: [PATCH 5/7] pdfs are just homework which already come as plaintext --- 412/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 412/.gitignore diff --git a/412/.gitignore b/412/.gitignore new file mode 100644 index 0000000..5f8bb43 --- /dev/null +++ b/412/.gitignore @@ -0,0 +1 @@ +*pdf From dc9f20b531cf4d5e55071706479455df77532f06 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Thu, 12 Sep 2019 10:50:25 -0700 Subject: [PATCH 6/7] ignoring homework for now --- 412/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/412/.gitignore b/412/.gitignore index 5f8bb43..01eb391 100644 --- a/412/.gitignore +++ b/412/.gitignore @@ -1 +1,2 @@ *pdf +homework/ From 71fe9e49cf2e983ca8a370263aaa21479591a60e Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Thu, 12 Sep 2019 11:07:25 -0700 Subject: [PATCH 7/7] update topics --- 312/notes/topics.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/312/notes/topics.md b/312/notes/topics.md index 5a5e2ba..91c6158 100644 --- a/312/notes/topics.md +++ b/312/notes/topics.md @@ -1,10 +1,15 @@ # Things that get covered in this class +## Attack Types + +* Known Plain text +* Known Cipher text ## Ciphers -_Just the ones covered_: +_Note that we focus(a ton) on the properties of these ciphers both forwards & backwards_ +* Caesar Cipher * _Rot Ciphers_ -* Rail fence +* Rail Fence * Row Transposition