Skip to content

Commit 29edf8d

Browse files
authored
Update 12-cryptography.livemd
1 parent 7699ef7 commit 29edf8d

File tree

1 file changed

+37
-58
lines changed

1 file changed

+37
-58
lines changed

modules/12-cryptography.livemd

Lines changed: 37 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,40 @@
1-
# ESCT: Part 12 - Cryptography (Draft)
1+
# ESCT: Part 12 - Cryptography
22

33
## Introduction
44

5-
> ### 🛠 <span style="color:goldenrod;">MODULE UNDER CONSTRUCTION - Please move to next module</span>
6-
7-
8-
## Table of Contents
9-
10-
* [Past and Present](#past-and-present)
11-
* [Types and Algorithms](#types-and-algorithms)
12-
* [Implementation in Modern Applications](#implementation-in-modern-applications)
13-
* [Related Concepts](#related-concepts)
14-
* [Security Concerns](#security-concerns)
15-
16-
## Past and Present
17-
18-
### Description
5+
Cryptography is the process of transforming information or data from it's original form into one that is unreadable by systems, tools, or people unless they have a key. The part of the process that converts source data/information into the unreadable version is called encryption. Reversing that process is called decryption.
196

207
Like many concepts/technologies in security, cryptography is not new. Centuries of devisings ways to send messages between and among
218
known and trusted senders/receivers while making those messages unreadable for enemies or anyone else for whom the message is not intended.
229
Secret codes, etc.
2310

24-
### <span style="color:blue;">Example</span> / <span style="color:red;">Quiz</span>
11+
Cryptography, like speaking or writing in code, is used whenever there something that needs to be kept secret in an environment where there are multiple other parties who could see or hear the secret but are not the intentended receiptient. The sender and receiver agree upon a code to exchange messages. Additionally, written notes can be stored and unless a reader has the code, won't know what the actual message is.
2512

26-
*TODO: Make Example or Quiz Question*
13+
Cryptography is used throughout applications to protect sensitive information that while is needed for the operation of the application and it's components, is not intended to be openly shared. This module highlights how cryptography is applied
2714

28-
```elixir
15+
## Table of Contents
2916

30-
```
17+
* [Types and Algorithms](#types-and-algorithms)
18+
* [Implementation in Modern Applications](#implementation-in-modern-applications)
19+
* [Related Concepts](#related-concepts)
20+
* [Security Concerns](#security-concerns)
3121

3222
## Types and Algorithms
3323

3424
### Description
35-
Different types depending on
25+
26+
There are two categories of cryptography, symmetric and asymmetric and within these categories, there are a variety of algorthims that are distinguished by
3627
-how data gets chopped up to be encrypted
3728
-how many keys are involved in the encryption/decryption process
3829
-how the keys get generated/used (symmetric/asymmetric)
3930
-key size
4031
-number of cycles
41-
-for complex algorithms etc..
4232

43-
symmetric encryption - secret key - one key used for encryption and decryption . Use this for performance/efficiency
44-
--application
45-
asymmetric encryption - aka public-key cryptography - two keys, one for encrypting one for decrpyting, one shared (pubic) one kept secret(private)
46-
--application digital signatures
33+
In symmetric encryption, which is also called secret key encryption, a single key used for both encryption and decryption. Symmetric cryptography is bested used when performance and efficiency are important to the application component using/accessing the data to be secured.
4734

48-
Old (Cracked - don't use)
35+
In asymmetric encryption, which is also called public-key cryptography, two related but separte keys are generated and then one is used for encrypting while the other for decrpyting. The keys include one that is meant to be shared (pubic key) and one that must always be kept secret(private) but in this public key infrastructure (PKI) system, both keys work to secure client-server interactions, secure VPN connectsion, certificates, digital signatures, and help ensure the technology and data in the system is only accessible by authenticated, and authorized entities with keys.
4936

50-
Newer (Resilient/proven secure by industry)
51-
AES - symmetric; CBC and GCM modes most secure
52-
53-
Diffie-Hellman key exchange
54-
RSA
55-
56-
TLS cipher suites
37+
When selecting an algorithm, best practice is to never build your own, and to always use established and proven algorithms, vetted and recommended by industry experts like NIST.
5738

5839
[symmetric cryptography](https://developer.mozilla.org/en-US/docs/Glossary/Symmetric-key_cryptography)
5940
[NIST](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-77r1.pdf)
@@ -62,24 +43,32 @@ TLS cipher suites
6243

6344
*TODO: Make Example or Quiz Question*
6445

65-
```elixir
46+
```
47+
Older ciphers/algorithms have been proven to be insecure usually due to the weakness of the mathematics invovled in the algorithm or due to the key lenght. Both of these can make it trivial for a malicious actor to decrypt information/data meant to be kept secret.
48+
49+
Newer (Resilient/proven secure by industry)
50+
AES - symmetric; CBC and GCM modes most secure
51+
52+
Diffie-Hellman key exchange
53+
RSA
6654
6755
```
6856

6957
## Implementation in Modern Applications
7058

7159
### Description
72-
In-transit
73-
TLS/SSL
74-
SSH
60+
Modern applications have many components that store, process, transmit a variety of information and data. Often that information/data consists of "secrets" or is otherwise sensitive. This includes things like personal information on customers, user credentials, of anything else application developers would like to keep secret.
61+
62+
API keys, tokens, passwords and other credentials to access privileged components and features, senstivitve data (PII, healthcare), private keys, signing certificates, are all examples of information that should not be available for every users and indeed, kept internal to the organization.
63+
64+
Much of this information is not static, however, and need sto be transmitted between client and server, stored in databases, used in source code and thus to secure this data, look to implement cryptography both at rest and in transit.
7565

76-
At rest
77-
Algorithms above
66+
Using. cryptography to protect this information wherever it is in the application, sent between services, stored in databases, used in source code is the best way to ensure it's security and confidentiality.
7867

79-
Best practices for secure algorithms
68+
In-transit, dnsure all requests/responses are sent using the secure version of the HTTP protocol, HTTPS. HTTP over TLS. Additionally, For remote access into development environments, SSH, VPN - for access to sensitive development environment internal to an organization/remote accessover a network.
69+
70+
In elixir, https (enabled)
8071

81-
Use those recommended by NIST -
82-
Programming language frameworks have built in libraries.
8372

8473
For elixir, ExCrypto module[ExCrypto](https://hexdocs.pm/ex_crypto/ExCrypto.html)
8574

@@ -98,7 +87,7 @@ use HTTPS which implements encrpytion over a channel. Diffie-Hellman
9887
*TODO: Make Example or Quiz Question*
9988
[
10089
](https://hexdocs.pm/plug/https.html)
101-
90+
[Erlang crypto module](https://elixir-lang.org/getting-started/erlang-libraries.html#the-crypto-module)
10291
```elixir
10392

10493
```
@@ -115,12 +104,6 @@ Hash Algorithms - SHA1, SHA2, MD5 (obsolete) - follow recommendations from
115104

116105
NIST [Approved Hash Algorithms](https://csrc.nist.gov/Projects/Hash-Functions)
117106

118-
Digital Certificates - Application of cryptography/private keys
119-
120-
121-
NIST
122-
[Erlang crypto module](https://elixir-lang.org/getting-started/erlang-libraries.html#the-crypto-module)
123-
124107
### <span style="color:blue;">Example</span> / <span style="color:red;">Quiz</span>
125108

126109
*TODO: Make Example or Quiz Question*
@@ -131,14 +114,6 @@ NIST
131114

132115
## Security Concerns
133116

134-
Key Management
135-
Hardcoding keys in code
136-
Old/Cracked protocols
137-
138-
Recommendations
139-
-Recommended algorithms
140-
-Sources for publishing notices when algorithms become cracked/obsolete and new
141-
142117
Cryptographic Failures are the number two most common issue on the OWASP Top 10
143118
A02:2021 – Cryptographic Failures
144119

@@ -153,7 +128,11 @@ For authentication/TLS RSA, DSA, and ECDSA with 128-bit
153128
security strength (for example, RSA with
154129
3072-bit or larger key)
155130

156-
[
131+
Beware of hardcoding keys, private keys, in source code where they can be discovered by malicious actors. Avoid building your own crytographic mechanisms or using outdated protocols.
132+
133+
Follow NIST Recommendations for configuring the most secure algorithms when building your applications and securing secrets and data.
134+
135+
[Recommended algorithms
157136
](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-77r1.pdf)[
158137
NIST](https://www.nist.gov/cryptography)
159138
[Encryption Standard](https://csrc.nist.gov/Projects/block-cipher-techniques)

0 commit comments

Comments
 (0)