You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Exposes an interface to the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198. An HMAC is a cryptographic hash that uses a key to sign a message. The receiver verifies the hash by recomputing it using the same key.
70
+
71
+
#### `create(hash, secret, callback)`
72
+
73
+
-`hash: String`
74
+
-`secret: Buffer`
75
+
-`callback: Function`
76
+
77
+
##### `digest(data, callback)`
78
+
79
+
-`data: Buffer`
80
+
-`callback: Function`
81
+
82
+
### `aes`
83
+
Expoes an interface to AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
84
+
85
+
This uses `CTR` mode.
86
+
87
+
#### `create(key, iv, callback)`
88
+
89
+
-`key: Buffer` The key, if length `16` then `AES 128` is used. For length `32`, `AES 256` is used.
90
+
-`iv: Buffer` Must have length `16`.
91
+
-`callback: Function`
92
+
93
+
##### `encrypt(data, callback)`
94
+
95
+
-`data: Buffer`
96
+
-`callback: Function`
97
+
98
+
##### `encrypt(data, callback)`
99
+
100
+
-`data: Buffer`
101
+
-`callback: Function`
102
+
103
+
104
+
### `webcrypto`
105
+
106
+
Depending on the environment this is either an instance of [node-webcrypto-ossl](https://github.com/PeculiarVentures/node-webcrypto-ossl) or the result of `window.crypto`.
107
+
108
+
### `keys`
109
+
110
+
### `generateKeyPair(type, bits, callback)`
111
+
112
+
-`type: String`, only `'RSA'` is currently supported
113
+
-`bits: Number` Minimum of 1024
114
+
-`callback: Function`
115
+
116
+
Generates a keypair of the given type and bitsize.
117
+
118
+
### `generateEphemeralKeyPair(curve, callback)`
119
+
120
+
-`curve: String`, one of `'P-256'`, `'P-384'`, `'P-521'` is currently supported
121
+
-`callback: Function`
122
+
123
+
Generates an ephemeral public key and returns a function that will compute the shared secret key.
124
+
125
+
Focuses only on ECDH now, but can be made more general in the future.
0 commit comments