0.0.3 • Published 4 years ago

sigle-step-kdf-nist v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

npm version Build Status

Single Step KDF (NIST SP 800-56C)

Single-Step Key Derivation function following NIST SP 800-56C revision 1, chapter 4 in TypeScript/JavaScript fully compatible with NodeJS.

Quick start

import { singleStepKDF, hexToBytes, bytesToHex } from "single-step-kdf";

const hexSingleStepKDF = () => {
  const sharedSecretString = "test";
  const sharedSecret: Uint8Array = hexToBytes(sharedSecretString);
  const fixedInfo = JSON.stringify({ info: "some info" });

  const kdf = singleStepKDF(
    "sha256",
    sharedSecret,
    32,
    hexToBytes(fixedInfo)
  );

  return bytesToHex(kdf).toUpperCase();
};

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago