Closed tymc7 closed 6 years ago
Started doing some research and plan to pick it up more tonight. Here is my list of links that i've found helpful so har:
Encryption Strategies:
Encryption Techniques:
Other Useful Links:
I've gone ahead and summarized some of my research thus far, which currently is just a bunch of youtube videos.
Each user has a private key. Let these be represented as p_a for Alice, p_b for Bob, and p_s for the server. Alices mixes her private key, p_a, with server key, p_s, resulting in a hard to reverse combination, (p_a)(p_s), that is passed over the server to Bob. Bob does the same and passes his private/server combination, (p_b)(p_s), to Alice. Both Alice and Bob add their private key to the combination they received from the other, resulting in a shared key the server doesn't have access to, (p_a)(p_b)(p_s), - note the central operation of DH is commutative and thus both Alice and Bob end up with the same key.
What is the weakness of DH? A man in the middle attack. Suppose there is Shawn. Shawn might pretend to be Bob, and send his (p_sh)(p_s) to Alice. Since Alice doesn't know what Bob's incoming combined key looks like, she might presume Shawn is Bob and begin sharing secrets with Shawn. This issue can also work in the other direction where Shawn tricks Bob into thinking that he's Alice. Shawn can then faciliate a conversation of secrets between Alice and Bob all while listening in. How is this resolved? Signature verification. For example w/ RSA. When Alice initiates secret sharing by sending her combined key, (p_a)(p_s) to Bob. Bob sends his combined key along with a hashed version of the key signed with his private key. Alice performs signature verification: she takes the data and performs the same hashing function Bob used. She then compares this to Bob's hashed message decrypted by his public key. If they match, the message was sent by Bob .
Web Crypto uses native crypto libraries from the browser. Implemented encryption algorithms in JavaScript can be slow and insecure. Support across browser and os except ios (based on 2016 video). TLS does not provide end-to-end security.
API lives in Browser's DOM, is not part of JS, lives in window.crypto object. This window.crypto object has a method window.crypto.getRandomValues(buffer), which stores cryptographically strong random numbers in a chunk of memory and returns this chunk to you.
Code Example:
// Declare a new buffer, 16 byte array
buf = new Uint8Array(16); // Uint8Array returns unsigned 8 bit arrays with 0s
window.crypto.getRandomValues(buf); // fills with random values
Another part of the API lives in window.crypto.subtle that contains asynchronous methods, that return promises instead of using callbacks
Code Example:
// line by line explanation:
// create a key usable for the AES-CBC algorithm, of length 256
// boolean says whether key can be exported or not
// usage: to be used for encryption and decryption
p = window.crypto.subtle.generateKey(
{name: "AES-CBC", length: 256},
true,
["encrypt", "decrypt"]
);
// regardless of whether or not promise is resolved
// resolved promise handling can be defined with then method
p.then(function(result) {
key = result;
// result is an opaque CryptoKey object
// can be exported if allowed by key creator
});
//error handling
p.catch(function(err){
//handle error
});
The link provides code lab examples for asymetric encryption, passphrase encryption, and signature verification. The first 2 labs may not be very useful. The last may be useful in DH.
I watched a few different videos on YouTube, came up with this solution?
Issues:
Similar Ideas:
Web encryption:
I looked a lot into group messaging solutions. I think there's similarities with what we're trying to do.
Group Messaging:
I had an idea similar to how group messaging does things:
I can draw this out later tonight if it would be easier <3
Idea 3 - DH-like key shared secret scheme:
Alice updates her profile.
Alice requests/views Bob's profile.
Since we figured this out, should we close?
Yup!
Any information you find, let's comment on this issue. Slack has a tendency to delete conversations after a certain amount of time.