-
Notifications
You must be signed in to change notification settings - Fork 701
/
index.js
63 lines (58 loc) · 1.27 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const inquirer = require('inquirer');
const NodeRSA = require('node-rsa');
const fs = require('fs-extra');
const main = async () => {
const answers = await inquirer.prompt([
{
type: 'input',
name: 'name',
message: "What's your name friend"
},
{
type: 'input',
name: 'street',
message: 'Street address'
},
{
type: 'input',
name: 'street2',
message: 'Suite or Apt # (optional)'
},
{
type: 'input',
name: 'city',
message: 'City'
},
{
type: 'input',
name: 'state',
message: 'State/Region'
},
{
type: 'input',
name: 'zip',
message: 'Postal Code'
},
{
type: 'input',
name: 'country',
message: 'Country'
},
{
type: 'input',
name: 'notes',
message: 'Any special notes for me?'
}
]);
const keyData = await fs.readFile('public.txt', 'utf8');
const key = NodeRSA();
key.importKey(keyData);
const encrypted = key.encrypt(answers, 'base64');
console.log('------ copy below ------');
console.log(encrypted);
console.log('------ copy above ------');
console.log(
'😍 \x20 Copy the encrypted address to stickers/<your-github-username>.txt and send a pull request'
);
};
main();