5.0.9 • Published 3 months ago

@libp2p/keychain v5.0.9

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
github
Last release
3 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

3 months ago

5.0.9-c2ff2e454

3 months ago

5.0.9

3 months ago

5.0.9-ad5cfd66a

3 months ago

5.0.9-a5cd8cfbe

3 months ago

5.0.8-7383821e1

3 months ago

5.0.8-d34642db1

3 months ago

5.0.8-a657bbd2e

3 months ago

5.0.8-717731e49

3 months ago

5.0.8

3 months ago

5.0.7-3bc9769b8

3 months ago

5.0.7-3244ed086

3 months ago

5.0.7-4521cf1f7

3 months ago

5.0.7-aa8de9fd3

3 months ago

5.0.7-75301ac7d

3 months ago

5.0.7-e6b4158c6

3 months ago

5.0.6-a390db4a4

4 months ago

5.0.7

4 months ago

5.0.6-58784abf7

4 months ago

5.0.6-e99e8f448

4 months ago

5.0.6-dad979f9b

4 months ago

5.0.6-934a891f9

4 months ago

5.0.6-32c176fd5

4 months ago

5.0.6-b4f02a637

4 months ago

5.0.6-0d326d102

4 months ago

5.0.6-27b2fa6b6

4 months ago

5.0.6-d4da56961

4 months ago

5.0.6-661d6586a

4 months ago

5.0.6-80e798cdc

4 months ago

5.0.6-24fa1d5af

4 months ago

5.0.6-35b48025c

4 months ago

5.0.6-82bd42bcf

4 months ago

5.0.7-5d199f9b6

3 months ago

5.0.6-d7a818e8e

4 months ago

5.0.6-d9c7e0f7e

4 months ago

5.0.6

4 months ago

5.0.5-fa83ee1c7

4 months ago

5.0.5-c5988cce8

4 months ago

5.0.5-980038477

4 months ago

5.0.5-0c5957836

4 months ago

5.0.4-c258b35af

4 months ago

5.0.5

4 months ago

5.0.4

4 months ago

5.0.3-7f7ec82ae

4 months ago

5.0.3-b3272cfce

4 months ago

5.0.2-21fe841f2

4 months ago

5.0.3

4 months ago

5.0.2-c628c44c5

4 months ago

5.0.2-4fd7eb2e1

4 months ago

5.0.2-6ccbb06f0

4 months ago

5.0.1-34455b5f2

4 months ago

5.0.2

4 months ago

5.0.1

4 months ago

5.0.0-1210884ed

4 months ago

5.0.0-18dd3cb26

4 months ago

4.1.6-2bbaf4361

4 months ago

5.0.0

4 months ago

5.0.0-7cd984569

4 months ago

4.1.6-71e5f7a5b

4 months ago

4.1.6-81ebe4e47

4 months ago

4.1.6-e1ca9cced

4 months ago

4.1.6-5214dec4a

5 months ago

4.1.6-a142bb642

4 months ago

4.1.6-b6681bd25

4 months ago

4.1.6-c010d575c

4 months ago

5.0.0-d101aac4b

4 months ago

4.1.6-df330695a

5 months ago

4.1.6-dd7b329c4

5 months ago

4.1.6-2265e59ba

5 months ago

4.1.6-737b3ea5b

5 months ago

4.1.6-1675adee2

5 months ago

4.1.6

5 months ago

4.1.5-7655e5200

5 months ago

4.1.5-e211b46cc

5 months ago

4.1.5-50b897139

5 months ago

4.0.16-44791342

7 months ago

4.1.5-359265a3a

5 months ago

4.1.5-3c8dd5bbf

5 months ago

4.0.15-90d10b565

8 months ago

4.0.16-8e4fdcde9

7 months ago

4.0.15-12106b5b0

8 months ago

4.0.15-440c9b360

8 months ago

4.1.1-ce6da9896

7 months ago

4.0.16-d1f1c2be7

7 months ago

4.0.15-e69a2f1b6

8 months ago

4.1.0-3b9cbf7d8

7 months ago

4.1.0-0b55625d1

7 months ago

4.0.15-352699ab5

8 months ago

4.0.15-bc6556f96

8 months ago

4.1.4-7939dbd5c

5 months ago

4.1.1-d1aec4d9f

7 months ago

4.0.15-169c9d85e

8 months ago

4.0.15-7aec7bd45

8 months ago

4.1.2-4a994c5ef

6 months ago

4.0.15-f6fe2cc3c

8 months ago

4.1.0-15eb66428

7 months ago

4.0.16-9e0236627

7 months ago

4.1.1-3319ff41e

7 months ago

4.1.0-abb9f90c7

7 months ago

4.1.4

6 months ago

4.1.3

6 months ago

4.1.5

5 months ago

4.1.0

7 months ago

4.1.2

6 months ago

4.1.1

7 months ago

4.0.15-6011d3697

8 months ago

4.1.0-6573cb8b0

7 months ago

4.0.16-863b3de03

7 months ago

4.1.2-40902d99b

6 months ago

4.1.4-1dfb74e79

5 months ago

4.1.2-a8ec2bcb7

6 months ago

4.1.1-151bc46fb

7 months ago

4.1.1-e9b6a242a

6 months ago

4.1.0-b0b6cae12

7 months ago

4.1.4-0edbfe7af

6 months ago

4.0.16

8 months ago

4.0.15-7464dc00c

8 months ago

4.1.2-8b3114292

6 months ago

4.1.0-21cf7bc56

7 months ago

4.0.15-4bd8e4f79

8 months ago

4.1.2-a82ff8221

6 months ago

4.0.15-f4e572cd6

8 months ago

4.1.2-73f2b6b6d

6 months ago

4.1.0-af85a7cad

7 months ago

4.1.2-a130993ed

6 months ago

4.0.15-167bf2b3c

8 months ago

4.0.16-94cac115a

7 months ago

4.1.2-34cf1f7cd

6 months ago

4.0.15-62e32252a

8 months ago

4.0.15-769461d3b

8 months ago

4.1.3-f30e2ee8d

6 months ago

4.1.2-928801a80

6 months ago

4.1.3-944935f8d

6 months ago

4.1.1-e1f0b307c

7 months ago

4.1.4-c5dba70a9

5 months ago

4.0.15-757fb2674

8 months ago

4.0.15

8 months ago

4.0.14-1a41c28bb

8 months ago

4.0.14-1eb5b2713

8 months ago

4.0.14-8214dcfb0

8 months ago

4.0.14-a3e8beabd

8 months ago

4.0.14-5b7380259

8 months ago

4.0.14-1cc6a9405

8 months ago

4.0.14-7de56f244

8 months ago

4.0.14-1cd5aae11

8 months ago

4.0.14-48444f750

8 months ago

4.0.14-3c73707ff

8 months ago

4.0.14-9d4b0596f

8 months ago

4.0.14-43046b9ae

8 months ago

4.0.14-83c14d08f

8 months ago

4.0.14-7ae6063df

9 months ago

4.0.14-4ad63bb79

9 months ago

4.0.14-767b23e71

9 months ago

4.0.14-bfa7660d5

9 months ago

4.0.14-d9366f9aa

9 months ago

4.0.14-510d9ce65

9 months ago

4.0.14-1488a7371

9 months ago

4.0.14-a11e135c2

9 months ago

4.0.14

9 months ago

4.0.13-de3f7aeaf

9 months ago

4.0.14-9d13a2f6a

9 months ago

4.0.13-c82432312

9 months ago

4.0.13-3bc94b403

9 months ago

4.0.13-3d7a9da17

9 months ago

4.0.13-e1923b0a7

9 months ago

4.0.13-998fcaf94

9 months ago

4.0.13-90cfd25e2

9 months ago

4.0.12-2281f802b

9 months ago

4.0.13

9 months ago

4.0.12-c2181f0cf

9 months ago

4.0.12-fd1f8343d

9 months ago

4.0.12-eaf8ac7cf

9 months ago

4.0.12-acef72613

9 months ago

4.0.12-ea4f26285

9 months ago

4.0.12-31c78f4ed

9 months ago

4.0.12-08dabd390

9 months ago

4.0.11-2c56203f9

10 months ago

4.0.12

10 months ago

4.0.11-b17824a1d

10 months ago

4.0.11-732c436d4

10 months ago

4.0.11-936dbba10

10 months ago

4.0.11-2b2958fe6

10 months ago

4.0.10-3e515f007

10 months ago

4.0.11

10 months ago

4.0.10-d446c6c31

10 months ago

4.0.10-a2b41f793

10 months ago

4.0.10-80278b36b

10 months ago

4.0.10-3ffecc5bf

10 months ago

4.0.10-ab5f05763

10 months ago

4.0.10-1f589c822

10 months ago

4.0.10-4fc0a7d30

10 months ago

4.0.10-afe15f669

10 months ago

4.0.9-330a5ed72

10 months ago

4.0.9-59a97b61b

10 months ago

4.0.9-82901e785

10 months ago

4.0.10

10 months ago

4.0.9-bf720c045

10 months ago

4.0.9-1fc929c1c

10 months ago

4.0.9-f39ce5f13

11 months ago

4.0.9-e1798aa26

11 months ago

4.0.9-cad9cf007

11 months ago

4.0.9-fad3074b8

11 months ago

4.0.9-83ef3717e

11 months ago

4.0.9-ab466004b

11 months ago

4.0.9-a9cc0ee49

11 months ago

4.0.9-28e51652a

11 months ago

4.0.9-2122a713d

11 months ago

4.0.9-f71bc49bd

11 months ago

4.0.9

11 months ago

4.0.8-f0d2b52d0

11 months ago

4.0.8-e1c01370b

11 months ago

4.0.8-8072a2e59

11 months ago

4.0.8-b1b77adb4

11 months ago

4.0.8-bedfd0aa2

11 months ago

4.0.8-fb7c51c3c

12 months ago

4.0.7-2370d1c39

12 months ago

4.0.8

12 months ago

4.0.7-9891ecd73

12 months ago

4.0.7-dab5cf724

12 months ago

4.0.8-0c7bbbb07

12 months ago

4.0.7-0321812e7

12 months ago

4.0.7-1cb2408ac

12 months ago

4.0.7-03ff9fd82

12 months ago

4.0.7-e1db332a4

12 months ago

4.0.7-6f323de7d

12 months ago

4.0.7-c9ed1c7d6

12 months ago

4.0.7-f4dda4a3c

12 months ago

4.0.7-74fb5671d

12 months ago

4.0.7-72f0e09f7

12 months ago

4.0.7-dbc92ab74

12 months ago

4.0.7-2e464c099

12 months 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

1 year ago

2.0.1-7f60b579

1 year ago

3.0.3-46dc3ce9

1 year ago

3.0.3-6a02d765

1 year ago

3.0.3-d9159dd5

1 year ago

3.0.4-f1053159

1 year ago

4.0.1-561797a89

1 year ago

3.0.3-b599905c

1 year ago

2.0.1-a1ec46b5

1 year ago

3.0.5-cf3ae893

1 year ago

4.0.0-06e6d235f

1 year ago

3.0.4-b57bca44

1 year ago

3.0.3-24c1c248

1 year ago

3.0.0-5ffa7a74

1 year ago

4.0.1

1 year ago

3.0.3-13f5b48e

1 year ago

4.0.0

1 year ago

4.0.2

1 year ago

3.0.7-051154dd

1 year ago

3.0.0-c858ca7f

1 year ago

3.0.2-a31b420f

1 year ago

3.0.2-123ded59

1 year ago

3.0.7-8b82e68e8

1 year ago

3.0.3-0634e3b7

1 year ago

3.0.2-3345f28b

1 year ago

4.0.1-7861ed882

1 year ago

3.0.5-ab2c1f67

1 year ago

3.0.4-f09ac4a7

1 year ago

3.0.3-10cbc8fa

1 year ago

3.0.0-a4a10fd4

1 year ago

2.0.1-791f56f0

1 year ago

3.0.8-4a474d54d

1 year ago

3.0.0-e66f4891

1 year ago

3.0.3-9a69e6f7

1 year 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

1 year ago

3.0.3-4ef9c79c

1 year ago

3.0.2-364e0592

1 year ago

3.0.6-b686fb5a

1 year ago

3.0.4-6640116d

1 year ago

2.0.1-69c93ac5

1 year ago

3.0.3-7b2ddc17

1 year ago

3.0.5-b5a808af

1 year ago

3.0.4-e9099d40

1 year ago

3.0.3-28d6722f

1 year ago

3.0.8-adea7bbbf

1 year ago

3.0.3-122f1e67

1 year 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

1 year ago

3.0.3-4db2f5f5

1 year ago

3.0.7-d25d9510

1 year ago

3.0.4-7d8b1551

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.3-0ee4f784

1 year ago

3.0.5

1 year ago

2.0.1-eabf6f36

1 year ago

3.0.0

1 year ago

3.0.3-0ce318ec

1 year ago

3.0.3-f3fd7b62

1 year ago

3.0.3-c4eff4c5

1 year ago

3.0.6-7903d7a5

1 year ago

3.0.8-e2267d437

1 year ago

3.0.3-24a5edae

1 year ago

3.0.4-c97dea04

1 year ago

2.0.1-1f7e18b0

1 year ago

3.0.3-0d228f9f

1 year ago

3.0.8-13a870cbe

1 year ago

3.0.8-6625a27fc

1 year ago

3.0.3-01acccef

1 year ago

3.0.3-098ba082

1 year ago

2.0.1-57c32721

1 year ago

3.0.3-7517082d

1 year ago

3.0.8-d729d66a5

1 year ago

3.0.6-69581367

1 year ago

3.0.2-9c0353cf

1 year ago

2.0.1-5eee70a4

2 years ago

3.0.2-02b89323

1 year ago

3.0.4-e3ab1929

1 year 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

1 year ago

3.0.4-ae36e86b

1 year ago

3.0.3-73b87c5a

1 year ago

3.0.4-96166ada

1 year ago

3.0.6-025c082a

1 year ago

3.0.3-a533cc39

1 year ago

3.0.8-6b6ba9ab7

1 year ago

4.0.1-cf963694f

1 year ago

3.0.3-6abcd22f

1 year ago

3.0.3-2b755a82

1 year ago

3.0.4-91842c93

1 year ago

3.0.3-4559a624

1 year ago

3.0.6-d5ef1c91

1 year ago

3.0.3-87dc7e9f

1 year ago

3.0.2-32212959

1 year ago

3.0.8-effcfaa8e

1 year ago

2.0.1-b1024c6c

2 years ago

3.0.3-89778624

1 year ago

2.0.1-7debe031

1 year ago

3.0.4-6cb80f7d

1 year ago

3.0.8-d8f5bc211

1 year ago

3.0.0-58421e11

1 year ago

4.0.1-8c169db1b

1 year ago

3.0.3-63041afe

1 year 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

1 year ago

3.0.0-8f855a3c

1 year 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

1 year ago

3.0.8-9c67c5b3d

1 year ago

2.0.1-a41d25d4

1 year ago

4.0.0-551622a96

1 year ago

3.0.2-18567b7c

1 year ago

3.0.0-ef83dd1d

1 year ago

3.0.5-77e3cbc3

1 year ago

3.0.3-d9948596

1 year ago

3.0.3-e664d14f

1 year ago

4.0.1-6c1f0ee81

1 year ago

3.0.3-d30f09f2

1 year 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

1 year ago

3.0.6-16a87076

1 year ago

3.0.3-87165551

1 year ago

3.0.8-8f921ee97

1 year ago

3.0.8-8bb6d5333

1 year ago

2.0.1-c2232166

1 year ago

3.0.6-346ff5a2

1 year ago

3.0.4-c88de8e1

1 year ago

3.0.8-3dee5df4d

1 year ago

3.0.0-8f681db3

1 year ago

3.0.8-c960eb659

1 year ago

3.0.4-972b10a9

1 year ago

3.0.0-fdd80820

1 year ago

4.0.0-7682861f9

1 year ago

4.0.1-9197f10ba

1 year ago

3.0.2-e26848b0

1 year ago

3.0.2-5e85154b

1 year ago

3.0.2-eaac8943

1 year ago

3.0.4-e8123d3f

1 year ago

3.0.8-97ab31c0c

1 year ago

2.0.1-c999d6a7

1 year 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

1 year ago

4.0.0-8e4fbe13a

1 year ago

3.0.3-88c47f51

1 year ago

3.0.3-a6be8f0f

1 year 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

1 year ago

4.0.1-738dd40f1

1 year ago

3.0.8-7877a50e0

1 year ago

3.0.4-72319fe6

1 year ago

3.0.2-a1fbb7e2

1 year 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