5.0.9 • Published 5 months ago

@libp2p/keychain v5.0.9

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
github
Last release
5 months ago

@libp2p/keychain

libp2p.io Discuss codecov CI

Key management and cryptographically protected messages

About

  • Manages the lifecycle of a key
  • Keys are encrypted at rest
  • Enforces the use of safe key names
  • Uses encrypted PKCS 8 for key storage
  • Uses PBKDF2 for a "stetched" key encryption key
  • Enforces NIST SP 800-131A and NIST SP 800-132
  • Delays reporting errors to slow down brute force attacks

KeyInfo

The key management and naming service API all return a KeyInfo object. The id is a universally unique identifier for the key. The name is local to the key chain.

{
  "name": "rsa-key",
  "id": "QmYWYSUZ4PV6MRFYpdtEDJBiGs4UrmE6g8wmAWSePekXVW"
}

The key id is the SHA-256 multihash of its public key.

The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo.

Private key storage

A private key is stored as an encrypted PKCS 8 structure in the PEM format. It is protected by a key generated from the key chain's passPhrase using PBKDF2.

The default options for generating the derived encryption key are in the dek object. This, along with the passPhrase, is the input to a PBKDF2 function.

const defaultOptions = {
  // See https://cryptosense.com/parameter-choice-for-pbkdf2/
  dek: {
    keyLength: 512 / 8,
    iterationCount: 1000,
    salt: 'at least 16 characters long',
    hash: 'sha2-512'
  }
}

key storage

Physical storage

The actual physical storage of an encrypted key is left to implementations of interface-datastore.

A key benefit is that now the key chain can be used in browser with the js-datastore-level implementation.

Install

$ npm i @libp2p/keychain

Browser <script> tag

Loading this module through a script tag will make it's exports available as Libp2pKeychain in the global namespace.

<script src="https://unpkg.com/@libp2p/keychain/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

5.0.9-0a3406a05

5 months ago

5.0.9-c2ff2e454

5 months ago

5.0.9

5 months ago

5.0.9-ad5cfd66a

5 months ago

5.0.9-a5cd8cfbe

5 months ago

5.0.8-7383821e1

5 months ago

5.0.8-d34642db1

5 months ago

5.0.8-a657bbd2e

5 months ago

5.0.8-717731e49

5 months ago

5.0.8

5 months ago

5.0.7-3bc9769b8

5 months ago

5.0.7-3244ed086

5 months ago

5.0.7-4521cf1f7

5 months ago

5.0.7-aa8de9fd3

5 months ago

5.0.7-75301ac7d

5 months ago

5.0.7-e6b4158c6

5 months ago

5.0.6-a390db4a4

6 months ago

5.0.7

6 months ago

5.0.6-58784abf7

6 months ago

5.0.6-e99e8f448

6 months ago

5.0.6-dad979f9b

6 months ago

5.0.6-934a891f9

6 months ago

5.0.6-32c176fd5

6 months ago

5.0.6-b4f02a637

6 months ago

5.0.6-0d326d102

6 months ago

5.0.6-27b2fa6b6

6 months ago

5.0.6-d4da56961

6 months ago

5.0.6-661d6586a

6 months ago

5.0.6-80e798cdc

6 months ago

5.0.6-24fa1d5af

6 months ago

5.0.6-35b48025c

6 months ago

5.0.6-82bd42bcf

6 months ago

5.0.7-5d199f9b6

6 months ago

5.0.6-d7a818e8e

6 months ago

5.0.6-d9c7e0f7e

6 months ago

5.0.6

6 months ago

5.0.5-fa83ee1c7

6 months ago

5.0.5-c5988cce8

6 months ago

5.0.5-980038477

6 months ago

5.0.5-0c5957836

6 months ago

5.0.4-c258b35af

6 months ago

5.0.5

6 months ago

5.0.4

6 months ago

5.0.3-7f7ec82ae

6 months ago

5.0.3-b3272cfce

6 months ago

5.0.2-21fe841f2

6 months ago

5.0.3

6 months ago

5.0.2-c628c44c5

6 months ago

5.0.2-4fd7eb2e1

7 months ago

5.0.2-6ccbb06f0

7 months ago

5.0.1-34455b5f2

7 months ago

5.0.2

7 months ago

5.0.1

7 months ago

5.0.0-1210884ed

7 months ago

5.0.0-18dd3cb26

7 months ago

4.1.6-2bbaf4361

7 months ago

5.0.0

7 months ago

5.0.0-7cd984569

7 months ago

4.1.6-71e5f7a5b

7 months ago

4.1.6-81ebe4e47

7 months ago

4.1.6-e1ca9cced

7 months ago

4.1.6-5214dec4a

7 months ago

4.1.6-a142bb642

7 months ago

4.1.6-b6681bd25

7 months ago

4.1.6-c010d575c

7 months ago

5.0.0-d101aac4b

7 months ago

4.1.6-df330695a

7 months ago

4.1.6-dd7b329c4

7 months ago

4.1.6-2265e59ba

7 months ago

4.1.6-737b3ea5b

7 months ago

4.1.6-1675adee2

7 months ago

4.1.6

7 months ago

4.1.5-7655e5200

7 months ago

4.1.5-e211b46cc

7 months ago

4.1.5-50b897139

7 months ago

4.0.16-44791342

10 months ago

4.1.5-359265a3a

8 months ago

4.1.5-3c8dd5bbf

8 months ago

4.0.15-90d10b565

10 months ago

4.0.16-8e4fdcde9

10 months ago

4.0.15-12106b5b0

10 months ago

4.0.15-440c9b360

10 months ago

4.1.1-ce6da9896

9 months ago

4.0.16-d1f1c2be7

10 months ago

4.0.15-e69a2f1b6

10 months ago

4.1.0-3b9cbf7d8

9 months ago

4.1.0-0b55625d1

9 months ago

4.0.15-352699ab5

10 months ago

4.0.15-bc6556f96

10 months ago

4.1.4-7939dbd5c

8 months ago

4.1.1-d1aec4d9f

9 months ago

4.0.15-169c9d85e

10 months ago

4.0.15-7aec7bd45

10 months ago

4.1.2-4a994c5ef

9 months ago

4.0.15-f6fe2cc3c

10 months ago

4.1.0-15eb66428

9 months ago

4.0.16-9e0236627

10 months ago

4.1.1-3319ff41e

9 months ago

4.1.0-abb9f90c7

9 months ago

4.1.4

8 months ago

4.1.3

8 months ago

4.1.5

8 months ago

4.1.0

10 months ago

4.1.2

9 months ago

4.1.1

9 months ago

4.0.15-6011d3697

10 months ago

4.1.0-6573cb8b0

9 months ago

4.0.16-863b3de03

10 months ago

4.1.2-40902d99b

9 months ago

4.1.4-1dfb74e79

8 months ago

4.1.2-a8ec2bcb7

8 months ago

4.1.1-151bc46fb

9 months ago

4.1.1-e9b6a242a

9 months ago

4.1.0-b0b6cae12

9 months ago

4.1.4-0edbfe7af

8 months ago

4.0.16

10 months ago

4.0.15-7464dc00c

10 months ago

4.1.2-8b3114292

9 months ago

4.1.0-21cf7bc56

9 months ago

4.0.15-4bd8e4f79

10 months ago

4.1.2-a82ff8221

8 months ago

4.0.15-f4e572cd6

10 months ago

4.1.2-73f2b6b6d

9 months ago

4.1.0-af85a7cad

9 months ago

4.1.2-a130993ed

9 months ago

4.0.15-167bf2b3c

10 months ago

4.0.16-94cac115a

10 months ago

4.1.2-34cf1f7cd

8 months ago

4.0.15-62e32252a

10 months ago

4.0.15-769461d3b

10 months ago

4.1.3-f30e2ee8d

8 months ago

4.1.2-928801a80

9 months ago

4.1.3-944935f8d

8 months ago

4.1.1-e1f0b307c

9 months ago

4.1.4-c5dba70a9

8 months ago

4.0.15-757fb2674

10 months ago

4.0.15

11 months ago

4.0.14-1a41c28bb

11 months ago

4.0.14-1eb5b2713

11 months ago

4.0.14-8214dcfb0

11 months ago

4.0.14-a3e8beabd

11 months ago

4.0.14-5b7380259

11 months ago

4.0.14-1cc6a9405

11 months ago

4.0.14-7de56f244

11 months ago

4.0.14-1cd5aae11

11 months ago

4.0.14-48444f750

11 months ago

4.0.14-3c73707ff

11 months ago

4.0.14-9d4b0596f

11 months ago

4.0.14-43046b9ae

11 months ago

4.0.14-83c14d08f

11 months ago

4.0.14-7ae6063df

11 months ago

4.0.14-4ad63bb79

11 months ago

4.0.14-767b23e71

11 months ago

4.0.14-bfa7660d5

11 months ago

4.0.14-d9366f9aa

11 months ago

4.0.14-510d9ce65

11 months ago

4.0.14-1488a7371

11 months ago

4.0.14-a11e135c2

11 months ago

4.0.14

11 months ago

4.0.13-de3f7aeaf

11 months ago

4.0.14-9d13a2f6a

11 months ago

4.0.13-c82432312

11 months ago

4.0.13-3bc94b403

11 months ago

4.0.13-3d7a9da17

11 months ago

4.0.13-e1923b0a7

11 months ago

4.0.13-998fcaf94

11 months ago

4.0.13-90cfd25e2

11 months ago

4.0.12-2281f802b

11 months ago

4.0.13

11 months ago

4.0.12-c2181f0cf

11 months ago

4.0.12-fd1f8343d

12 months ago

4.0.12-eaf8ac7cf

12 months ago

4.0.12-acef72613

12 months ago

4.0.12-ea4f26285

12 months ago

4.0.12-31c78f4ed

12 months ago

4.0.12-08dabd390

12 months ago

4.0.11-2c56203f9

12 months ago

4.0.12

12 months ago

4.0.11-b17824a1d

12 months ago

4.0.11-732c436d4

12 months ago

4.0.11-936dbba10

12 months ago

4.0.11-2b2958fe6

12 months ago

4.0.10-3e515f007

12 months ago

4.0.11

12 months ago

4.0.10-d446c6c31

12 months ago

4.0.9-330a5ed72

1 year ago

4.0.9-59a97b61b

1 year ago

4.0.9-82901e785

1 year ago

4.0.10

1 year ago

4.0.9-bf720c045

1 year ago

4.0.9-1fc929c1c

1 year ago

4.0.9-f39ce5f13

1 year ago

4.0.9-e1798aa26

1 year ago

4.0.9-cad9cf007

1 year ago

4.0.9-fad3074b8

1 year ago

4.0.9-83ef3717e

1 year ago

4.0.9-ab466004b

1 year ago

4.0.9-a9cc0ee49

1 year ago

4.0.9-28e51652a

1 year ago

4.0.9-2122a713d

1 year ago

4.0.9-f71bc49bd

1 year ago

4.0.9

1 year ago

4.0.8-f0d2b52d0

1 year ago

4.0.8-e1c01370b

1 year ago

4.0.8-8072a2e59

1 year ago

4.0.8-b1b77adb4

1 year ago

4.0.8-bedfd0aa2

1 year ago

4.0.8-fb7c51c3c

1 year ago

4.0.7-2370d1c39

1 year ago

4.0.8

1 year ago

4.0.7-9891ecd73

1 year ago

4.0.7-dab5cf724

1 year ago

4.0.8-0c7bbbb07

1 year ago

4.0.7-0321812e7

1 year ago

4.0.7-1cb2408ac

1 year ago

4.0.7-03ff9fd82

1 year ago

4.0.7-e1db332a4

1 year ago

4.0.7-6f323de7d

1 year ago

4.0.7-c9ed1c7d6

1 year ago

4.0.7-f4dda4a3c

1 year ago

4.0.7-74fb5671d

1 year ago

4.0.7-72f0e09f7

1 year ago

4.0.7-dbc92ab74

1 year ago

4.0.7-2e464c099

1 year ago

4.0.7-9376e61a1

1 year ago

4.0.7-74477f6ea

1 year ago

4.0.7-f27138ca1

1 year ago

4.0.7-3e47d88fd

1 year ago

4.0.7-08f6f607d

1 year ago

4.0.7-8c6654c3a

1 year ago

4.0.6-092861e23

1 year ago

4.0.7

1 year ago

4.0.6

1 year ago

4.0.5-856ccd708

1 year ago

4.0.5-ddaa59a60

1 year ago

4.0.6-8bbd43628

1 year ago

4.0.5-4691f4173

1 year ago

4.0.5-ee7ffe9b9

1 year ago

4.0.5-821a38e24

1 year ago

4.0.5-900236724

1 year ago

4.0.5

1 year ago

4.0.4-444d83751

1 year ago

4.0.4-528d73781

1 year ago

4.0.4-d011f6130

1 year ago

4.0.4-581574d6d

1 year ago

4.0.4-ba7089984

1 year ago

4.0.4-388d02b33

1 year ago

4.0.4

1 year ago

4.0.3-5d1f68e92

1 year ago

4.0.3-28587d24f

1 year ago

4.0.3-4e0135c7d

1 year ago

4.0.3-cd8cafcd5

1 year ago

4.0.3-178fe2671

1 year ago

4.0.3-c00378909

1 year ago

4.0.3-6fd681d09

1 year ago

4.0.3-83dfc7dc8

1 year ago

4.0.3-984f13e42

1 year ago

4.0.3-ad6f70bf3

1 year ago

4.0.3-f71f2e14e

1 year ago

4.0.3-07f3afe2d

1 year ago

4.0.3-230afea4b

1 year ago

4.0.3-9eff7eff0

1 year ago

4.0.3-a7c6a93c6

1 year ago

4.0.3-f81be145a

1 year ago

4.0.3-01e9a5fe4

1 year ago

4.0.3

1 year ago

4.0.3-742915567

1 year ago

4.0.2-341581166

1 year ago

4.0.2-6d11e8268

1 year ago

4.0.2-d10506189

1 year ago

4.0.2-64a915ae9

1 year ago

4.0.2-3bf6387ff

1 year ago

4.0.2-93890c8f9

1 year ago

4.0.2-887c6ffe1

1 year ago

4.0.2-16588d27c

1 year ago

3.0.7-70d5efc2e

1 year ago

4.0.2-09dd02987

1 year ago

3.0.2-6b839807

2 years ago

2.0.1-7f60b579

2 years ago

3.0.3-46dc3ce9

2 years ago

3.0.3-6a02d765

2 years ago

3.0.3-d9159dd5

2 years ago

3.0.4-f1053159

1 year ago

4.0.1-561797a89

1 year ago

3.0.3-b599905c

2 years ago

2.0.1-a1ec46b5

2 years ago

3.0.5-cf3ae893

1 year ago

4.0.0-06e6d235f

1 year ago

3.0.4-b57bca44

2 years ago

3.0.3-24c1c248

2 years ago

3.0.0-5ffa7a74

2 years ago

4.0.1

1 year ago

3.0.3-13f5b48e

2 years ago

4.0.0

1 year ago

4.0.2

1 year ago

3.0.7-051154dd

1 year ago

3.0.0-c858ca7f

2 years ago

3.0.2-a31b420f

2 years ago

3.0.2-123ded59

2 years ago

3.0.7-8b82e68e8

1 year ago

3.0.3-0634e3b7

2 years ago

3.0.2-3345f28b

2 years ago

4.0.1-7861ed882

1 year ago

3.0.5-ab2c1f67

1 year ago

3.0.4-f09ac4a7

2 years ago

3.0.3-10cbc8fa

2 years ago

3.0.0-a4a10fd4

2 years ago

2.0.1-791f56f0

2 years ago

3.0.8-4a474d54d

1 year ago

3.0.0-e66f4891

2 years ago

3.0.3-9a69e6f7

2 years ago

3.0.5-68504939

1 year ago

4.0.0-a32e70bac

1 year ago

2.0.1-e9cafd3d

2 years ago

3.0.8-68db79f6b

1 year ago

3.0.4-28794fe4

1 year ago

4.0.0-bcf18265e

1 year ago

4.0.1-f537b3731

1 year ago

4.0.1-bca8d6e68

1 year ago

3.0.3-32825633

2 years ago

3.0.3-4ef9c79c

2 years ago

3.0.2-364e0592

2 years ago

3.0.6-b686fb5a

1 year ago

3.0.4-6640116d

2 years ago

2.0.1-69c93ac5

2 years ago

3.0.3-7b2ddc17

2 years ago

3.0.5-b5a808af

1 year ago

3.0.4-e9099d40

1 year ago

3.0.3-28d6722f

2 years ago

3.0.8-adea7bbbf

1 year ago

3.0.3-122f1e67

2 years ago

4.0.2-5a9362e21

1 year ago

3.0.7-fb8a6f188

1 year ago

2.0.1-6eab9c5e

2 years ago

3.0.3-725f5df1

2 years ago

3.0.3-4db2f5f5

2 years ago

3.0.7-d25d9510

1 year ago

3.0.4-7d8b1551

1 year ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.3-0ee4f784

2 years ago

3.0.5

1 year ago

2.0.1-eabf6f36

2 years ago

3.0.0

2 years ago

3.0.3-0ce318ec

2 years ago

3.0.3-f3fd7b62

2 years ago

3.0.3-c4eff4c5

2 years ago

3.0.6-7903d7a5

1 year ago

3.0.8-e2267d437

1 year ago

3.0.3-24a5edae

2 years ago

3.0.4-c97dea04

1 year ago

2.0.1-1f7e18b0

2 years ago

3.0.3-0d228f9f

2 years ago

3.0.8-13a870cbe

1 year ago

3.0.8-6625a27fc

1 year ago

3.0.3-01acccef

2 years ago

3.0.3-098ba082

2 years ago

2.0.1-57c32721

2 years ago

3.0.3-7517082d

2 years ago

3.0.8-d729d66a5

1 year ago

3.0.6-69581367

1 year ago

3.0.2-9c0353cf

2 years ago

2.0.1-5eee70a4

2 years ago

3.0.2-02b89323

2 years ago

3.0.4-e3ab1929

2 years ago

3.0.8-0b4a2ee79

1 year ago

3.0.7-dfbe0cc0

1 year ago

3.0.7-f4fac961

1 year ago

3.0.3-5294f14c

2 years ago

3.0.4-ae36e86b

2 years ago

3.0.3-73b87c5a

2 years ago

3.0.4-96166ada

2 years ago

3.0.6-025c082a

1 year ago

3.0.3-a533cc39

2 years ago

3.0.8-6b6ba9ab7

1 year ago

4.0.1-cf963694f

1 year ago

3.0.3-6abcd22f

2 years ago

3.0.3-2b755a82

2 years ago

3.0.4-91842c93

2 years ago

3.0.3-4559a624

2 years ago

3.0.6-d5ef1c91

1 year ago

3.0.3-87dc7e9f

2 years ago

3.0.2-32212959

2 years ago

3.0.8-effcfaa8e

1 year ago

2.0.1-b1024c6c

2 years ago

3.0.3-89778624

2 years ago

2.0.1-7debe031

2 years ago

3.0.4-6cb80f7d

2 years ago

3.0.8-d8f5bc211

1 year ago

3.0.0-58421e11

2 years ago

4.0.1-8c169db1b

1 year ago

3.0.3-63041afe

2 years ago

3.0.6-50442d7a

1 year ago

2.0.1-06f4901a

2 years ago

4.0.2-bcfa15993

1 year ago

3.0.7-1d141331a

1 year ago

3.0.3-20d5f220

2 years ago

3.0.0-8f855a3c

2 years ago

3.0.4-980857c3

1 year ago

2.0.1-daeb43d8

2 years ago

4.0.0-273d8177c

1 year ago

3.0.7-fdcb801e

1 year ago

4.0.2-10ea19700

1 year ago

3.0.2-4c1a33b3

2 years ago

3.0.8-9c67c5b3d

1 year ago

2.0.1-a41d25d4

2 years ago

4.0.0-551622a96

1 year ago

3.0.2-18567b7c

2 years ago

3.0.0-ef83dd1d

2 years ago

3.0.5-77e3cbc3

1 year ago

3.0.3-d9948596

2 years ago

3.0.3-e664d14f

2 years ago

4.0.1-6c1f0ee81

1 year ago

3.0.3-d30f09f2

2 years ago

3.0.5-62a56b54

1 year ago

4.0.1-53224004f

1 year ago

4.0.1-e7167fe52

1 year ago

3.0.0-72e81dc1

2 years ago

3.0.6-16a87076

1 year ago

3.0.3-87165551

2 years ago

3.0.8-8f921ee97

1 year ago

3.0.8-8bb6d5333

1 year ago

2.0.1-c2232166

2 years ago

3.0.6-346ff5a2

1 year ago

3.0.4-c88de8e1

2 years ago

3.0.8-3dee5df4d

1 year ago

3.0.0-8f681db3

2 years ago

3.0.8-c960eb659

1 year ago

3.0.4-972b10a9

2 years ago

3.0.0-fdd80820

2 years ago

4.0.0-7682861f9

1 year ago

4.0.1-9197f10ba

1 year ago

3.0.2-e26848b0

2 years ago

3.0.2-5e85154b

2 years ago

3.0.2-eaac8943

2 years ago

3.0.4-e8123d3f

1 year ago

3.0.8-97ab31c0c

1 year ago

2.0.1-c999d6a7

2 years ago

3.0.8-bb6ceb192

1 year ago

3.0.7-78db573f9

1 year ago

3.0.4-5a6a4379

1 year ago

2.0.1-5315f7bc

2 years ago

3.0.5-7534ae7b

1 year ago

3.0.0-8d49602f

2 years ago

4.0.0-8e4fbe13a

1 year ago

3.0.3-88c47f51

2 years ago

3.0.3-a6be8f0f

2 years ago

3.0.8-05b52d69c

1 year ago

2.0.1-7b5c54dd

2 years ago

3.0.4-f670307a

1 year ago

3.0.1-446fff87

2 years ago

4.0.1-738dd40f1

1 year ago

3.0.8-7877a50e0

1 year ago

3.0.4-72319fe6

2 years ago

3.0.2-a1fbb7e2

2 years ago

3.0.5-f9d1c072

1 year ago

3.0.8-74e84bc29

1 year ago

3.0.8-0f5c305af

1 year ago

3.0.5-50f912c2

1 year ago

2.0.1-f427cfc9

2 years ago

2.0.1-7fb23cd3

2 years ago

2.0.1-85a317bb

2 years ago

2.0.1-2e561fe9

2 years ago

2.0.1-42c1c097

2 years ago

2.0.1-879f4794

2 years ago

1.0.1

2 years ago

2.0.1-ab0e3980

2 years ago

2.0.1-8b0e6bef

2 years ago

2.0.1-d853d124

2 years ago

2.0.1-05abd49f

2 years ago

2.0.1-ea8a0637

2 years ago

2.0.1-3dfc236e

2 years ago

2.0.1-6fdaa7dc

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago