quantum-resistant-rustykey 0.0.5 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
**Note**: 🚧 WORK IN PROGRESS...do not pnpm install 🚧
|
|
2
2
|
|
|
3
|
-
# Quantum-Resistant RustyKey
|
|
3
|
+
# Quantum-Resistant RustyKey®
|
|
4
4
|
|
|
5
5
|
A WebAssembly implementation of ML-KEM (Quantum-Resistant Signatures) for both Node.js and web environments. This is an improved version of the NIST winner's standard implementation, patched to withstand side-channel attacks.
|
|
6
6
|
|
|
@@ -11,8 +11,50 @@ A WebAssembly implementation of ML-KEM (Quantum-Resistant Signatures) for both N
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
## About
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
You use this quantum-resistant RustyKey® npm package mainly for secure key exchange, specifically as a Key Encapsulation Mechanism (KEM). It's designed to securely establish a shared secret between two parties, which is then used for encryption with a symmetric algorithm like AES. While Kyber can be used for encryption, its primary function is to encapsulate and transmit a session key, not the data itself.
|
|
15
|
+
|
|
16
|
+
Here's a more detailed explanation:
|
|
17
|
+
Key Exchange (KEM):
|
|
18
|
+
- to facilitate the secure exchange of a shared secret key between two parties. This shared key is then used to encrypt and decrypt data using a separate, symmetric encryption algorithm.
|
|
19
|
+
Not Direct Encryption:
|
|
20
|
+
- doesn't directly encrypt the data itself. It's designed to securely encapsulate a session key, which is then used to encrypt the actual data using a symmetric encryption algorithm.
|
|
21
|
+
Hybrid Approach:
|
|
22
|
+
- often used in a hybrid approach, combining it with symmetric encryption algorithms like AES for stronger security. Used to securely exchange a session key, then used to encrypt the data using AES.
|
|
23
|
+
Post-Quantum Security:
|
|
24
|
+
- a post-quantum cryptosystem, meaning it is designed to be secure against attacks from quantum computers. This makes it a valuable tool for securing communication in the future when quantum computers become more powerful.
|
|
25
|
+
|
|
26
|
+
In essence, RustyKey® quantum-resistant npm package creates a secure handshake, establishing a shared secret key that can then be used to encrypt and decrypt data with a more efficient symmetric encryption algorithm
|
|
27
|
+
|
|
28
|
+
## Web Assembly implementation
|
|
29
|
+
### Pros
|
|
30
|
+
#### Highly secure
|
|
31
|
+
Wasm operates within a sandboxed environment, isolating it from the host system. This prevents malicious code within the Wasm module from directly accessing sensitive data or compromising system resources. JavaScript, while also sandboxed, has a larger attack surface due to its dynamic nature and access to a wider range of APIs.
|
|
32
|
+
#### Reduced Attack Surface
|
|
33
|
+
Since Wasm modules have limited access to system resources and APIs, their attack surface is smaller than that of JavaScript. This makes it more difficult for attackers to exploit vulnerabilities.
|
|
34
|
+
#### fast
|
|
35
|
+
(mostly!) as Web Assembly (WASM) implementations of algorithms offer near-native performance due to WASM's low-level of bytecode, which itself is usually orders of magnitude faster than JavaScript for computationally intensive tasks.
|
|
36
|
+
#### Controlled Imports
|
|
37
|
+
Wasm modules have explicit import declarations, defining the exact functions they can access from the host environment (usually JavaScript). This allows for fine-grained control over the module's capabilities. In contrast, JavaScript has more implicit access to APIs, making it harder to restrict its behavior.
|
|
38
|
+
#### Static Analysis
|
|
39
|
+
Wasm's binary format allows for static analysis and code validation. This enables browsers to verify the module's structure and behavior before execution, reducing the risk of introducing vulnerabilities. JavaScript, being dynamically typed and interpreted, is more challenging to analyze statically.
|
|
40
|
+
#### Compilation and Validation
|
|
41
|
+
Wasm code is compiled into a low-level bytecode that is validated before execution. This process helps to identify and prevent many types of vulnerabilities that are common in JavaScript, such as buffer overflows.
|
|
42
|
+
|
|
43
|
+
### Cons
|
|
44
|
+
#### Complex
|
|
45
|
+
WASM is more complex to work with than JavaScript, and requires a build process to compile code into WASM modules and manual memory management, which is why this package exists...to make it easier for developers and end-users to incorporate the benefits of increased security and faster speed into their authentication, authorization and other encryption/decryption workflows.
|
|
46
|
+
|
|
47
|
+
#### No Direct DOM Access
|
|
48
|
+
WASM cannot directly manipulate the DOM. It relies on JavaScript to interact with the DOM, which adds complexity and can affect performance when frequent DOM interactions are needed.
|
|
49
|
+
#### Garbage Collection
|
|
50
|
+
WASM relies on JavaScript for garbage collection, which can be less efficient compared to languages with native garbage collection.
|
|
51
|
+
#### Limited API Access
|
|
52
|
+
WASM has limited access to browser and Node.js APIs compared to JavaScript, requiring JavaScript to act as a bridge for these interactions.
|
|
53
|
+
#### Data Transfer Overhead
|
|
54
|
+
Passing data between WASM and JavaScript can incur performance overhead due to serialization and deserialization.
|
|
55
|
+
|
|
56
|
+
### Algorithm source
|
|
57
|
+
Based on a suite of "Cryptographic Suite for Algebraic Lattices" (CRYSTALS) based on hard problems over module lattices, designed to withstand attacks by large quantum computers, and selected among the winners of the [NIST post-quantum cryptography project](https://pq-crystals.org/index.shtml)
|
|
16
58
|
|
|
17
59
|
| Package | Registry | Description |
|
|
18
60
|
|---------|----------|-------------|
|