initial commit
[squeep-mystery-box] / lib / version-parameters.js
1 'use strict';
2
3 /**
4 * Supported packings/cipher types.
5 * To be useful, any cipher included here must be Authenticated Encryption with Additional Data (AEAD).
6 * More preferable versions are numbered higher.
7 */
8 const allVersions = {
9 1: {
10 version: 1,
11 algorithm: 'aes-256-gcm',
12 algOptions: {},
13 versionBytes: 1,
14 flagsBytes: 1,
15 ivBytes: 12,
16 saltBytes: 16,
17 tagBytes: 16,
18 keyBytes: 32,
19 },
20 2: {
21 version: 2,
22 algorithm: 'chacha20-poly1305', // Prefer this over NIST because we stan djb
23 algOptions: {
24 authTagLength: 16,
25 },
26 versionBytes: 1,
27 flagsBytes: 1,
28 ivBytes: 12,
29 saltBytes: 16,
30 tagBytes: 16,
31 keyBytes: 32,
32 },
33 3: {
34 version: 3,
35 algorithm: 'xchacha20-poly1305', // Not yet available...
36 algOptions: {
37 authTagLength: 16,
38 },
39 versionBytes: 1,
40 flagsBytes: 1,
41 ivBytes: 24,
42 saltBytes: 16,
43 tagBytes: 16,
44 keyBytes: 32,
45 },
46 };
47
48 module.exports = allVersions;