You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/12-cryptography.livemd
+37-58Lines changed: 37 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,59 +1,40 @@
1
-
# ESCT: Part 12 - Cryptography (Draft)
1
+
# ESCT: Part 12 - Cryptography
2
2
3
3
## Introduction
4
4
5
-
> ### 🛠 <spanstyle="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.
19
6
20
7
Like many concepts/technologies in security, cryptography is not new. Centuries of devisings ways to send messages between and among
21
8
known and trusted senders/receivers while making those messages unreadable for enemies or anyone else for whom the message is not intended.
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.
25
12
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
27
14
28
-
```elixir
15
+
## Table of Contents
29
16
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)
31
21
32
22
## Types and Algorithms
33
23
34
24
### 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
36
27
-how data gets chopped up to be encrypted
37
28
-how many keys are involved in the encryption/decryption process
38
29
-how the keys get generated/used (symmetric/asymmetric)
39
30
-key size
40
31
-number of cycles
41
-
-for complex algorithms etc..
42
32
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.
47
34
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.
49
36
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.
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
66
54
67
55
```
68
56
69
57
## Implementation in Modern Applications
70
58
71
59
### 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.
75
65
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.
78
67
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)
80
71
81
-
Use those recommended by NIST -
82
-
Programming language frameworks have built in libraries.
83
72
84
73
For elixir, ExCrypto module[ExCrypto](https://hexdocs.pm/ex_crypto/ExCrypto.html)
85
74
@@ -98,7 +87,7 @@ use HTTPS which implements encrpytion over a channel. Diffie-Hellman
-Sources for publishing notices when algorithms become cracked/obsolete and new
141
-
142
117
Cryptographic Failures are the number two most common issue on the OWASP Top 10
143
118
A02:2021 – Cryptographic Failures
144
119
@@ -153,7 +128,11 @@ For authentication/TLS RSA, DSA, and ECDSA with 128-bit
153
128
security strength (for example, RSA with
154
129
3072-bit or larger key)
155
130
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.
0 commit comments