Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

importKey does not support the PBKDF2 algorithm #52

Description

@valhovey

I am attempting to do PBKDF2 key generation via a passphrase and cannot generate the key material for input to the deriveKey call with the following error:

Error: unsupported algorithm

Environment info:

  • React Native 0.63.4
  • Ejected Expo app (ran npx pod-install before this)
  • MacOS, simulating on iOS 14.5 on iPhone 11 with XCode 12.5

Code to repro:

import crypto from 'isomorphic-webcrypto';

const encoder = new TextEncoder();

async function repro() {
  await crypto.ensureSecure();

  const keyMaterial = await crypto.subtle.importKey(
    'raw',
    encoder.encode(passphrase),
    {
      name: 'PBKDF2',
    },
    false,
    ['deriveBits', 'deriveKey'],
  );
}

repro();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions