encrypt-rsa 2.0.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### 2.0.1 (2022-03-23)
2
+
3
+ ##### Documentation Changes
4
+
5
+ * update docs ([c06781e3](https://github.com/miladezzat/encrypt-rsa/commit/c06781e34ec15219f12c1be880005b0ab6696d4a))
6
+
1
7
  ## 2.0.0 (2022-03-23)
2
8
 
3
9
  ##### Documentation Changes
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  RSA algorithm is asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. As the name describes that the Public Key is given to everyone and Private key is kept private.
10
10
 
11
- ### For more explanation about RSA Algorithm visit [https://milad-ezzat.vercel.app/posts/rsa-encryption-algorithm](https://milad-ezzat.vercel.app/posts/rsa-encryption-algorithm)
11
+ ## For more explanation about RSA Algorithm visit [RSA algorithm](https://milad-ezzat.vercel.app/blog/encrypt-by-rsa-algorithm)
12
12
 
13
13
  1. [Installation](#installation)
14
14
  2. [Usage](#usage)
@@ -41,16 +41,12 @@ const nodeRSA = new NodeRSA();
41
41
 
42
42
  const { privateKey, publicKey } = nodeRSA.createPrivateAndPublicKeys()
43
43
 
44
- // to save your keys
45
- fs.writeFileSync('./private-key', privateKey);
46
- fs.writeFileSync('./public-key', publicKey);
47
-
48
44
 
49
45
  // you must have 'public-key' file the key you want to encrypt by it
50
46
 
51
47
  const encryptedText = nodeRSA.encryptStringWithRsaPublicKey({
52
48
  text: 'hello',
53
- keyPath: path.join(__dirname, './public-key')
49
+ publicKey: public
54
50
  });
55
51
 
56
52
  console.log({ encryptedText });
@@ -63,12 +59,10 @@ console.log({ encryptedText });
63
59
 
64
60
  const decryptedText = nodeRSA.decryptStringWithRsaPrivateKey({
65
61
  text: encryptedText,
66
- keyPath: path.join(__dirname, './private-key')
62
+ privateKey: private
67
63
  });
68
64
 
69
65
  console.log({ decryptedText });
70
66
  // result: { decryptedText: 'hello' }
71
67
 
72
68
  ```
73
- for more information about RSA:
74
- [https://simple.wikipedia.org/wiki/RSA_algorithm](https://simple.wikipedia.org/wiki/RSA_algorithm)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "encrypt-rsa",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "this is a little module use to encrypt and decrypt strings with RSA keys (public and private keys)",
5
5
  "main": "./build/index.js",
6
6
  "module": "./build/index.js",