Merge pull request #394 from ha-sante/patch-1

Update create-secrets.mdx
This commit is contained in:
BlackMagiq
2023-03-05 12:34:26 +07:00
committed by GitHub
@@ -23,6 +23,7 @@ Prerequisites:
```js ```js
const crypto = require('crypto'); const crypto = require('crypto');
const axios = require('axios'); const axios = require('axios');
const nacl = require('tweetnacl');
const ALGORITHM = 'aes-256-gcm'; const ALGORITHM = 'aes-256-gcm';
const BLOCK_SIZE_BYTES = 16; const BLOCK_SIZE_BYTES = 16;
@@ -94,9 +95,9 @@ const createSecrets = async () => {
// 4. decrypt the project key with your private key // 4. decrypt the project key with your private key
const projectKey = nacl.box.open( const projectKey = nacl.box.open(
util.decodeBase64(encryptedProjectKey), util.decodeBase64(encryptedProjectKey),
util.decodeBase64(projectKey.nonce), util.decodeBase64(encryptedProjectKey.nonce),
util.decodeBase64(projectKey.sender.publicKey), util.decodeBase64(encryptedProjectKey.sender.publicKey),
util.decodeBase64(privateKey) util.decodeBase64(PSWD)
); );
// 5. encrypt your secret(s) with the project key // 5. encrypt your secret(s) with the project key