@talismn/keyring 0.0.0-pr1866-20250409123927 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,17 +47,13 @@ const getAccountPlatform = account => {
47
47
  // Derive a key generated with PBKDF2 that will be used for AES-GCM encryption
48
48
  const deriveKey = async (password, salt) => {
49
49
  // Deriving 32-byte key using PBKDF2 with 100000 iterations and SHA-256
50
- const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveBits"]);
51
-
52
- // NOTE: react-native-quick-crypto (our `global.crypto` polyfill on Talisman mobile) doesn't support `crypto.subtle.deriveKey`.
53
- // But, we can work around this by using `crypto.subtle.deriveBits` and `crypto.subtle.importKey`, which when used together
54
- // can provide the same functionality as `crypto.subtle.deriveKey`.
55
- return crypto.subtle.importKey("raw", await crypto.subtle.deriveBits({
50
+ const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveKey"]);
51
+ return crypto.subtle.deriveKey({
56
52
  name: "PBKDF2",
57
53
  salt,
58
- iterations: 100_000,
54
+ iterations: 100000,
59
55
  hash: "SHA-256"
60
- }, keyMaterial, 256), {
56
+ }, keyMaterial, {
61
57
  name: "AES-GCM",
62
58
  length: 256
63
59
  }, false, ["encrypt", "decrypt"]);
@@ -47,17 +47,13 @@ const getAccountPlatform = account => {
47
47
  // Derive a key generated with PBKDF2 that will be used for AES-GCM encryption
48
48
  const deriveKey = async (password, salt) => {
49
49
  // Deriving 32-byte key using PBKDF2 with 100000 iterations and SHA-256
50
- const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveBits"]);
51
-
52
- // NOTE: react-native-quick-crypto (our `global.crypto` polyfill on Talisman mobile) doesn't support `crypto.subtle.deriveKey`.
53
- // But, we can work around this by using `crypto.subtle.deriveBits` and `crypto.subtle.importKey`, which when used together
54
- // can provide the same functionality as `crypto.subtle.deriveKey`.
55
- return crypto.subtle.importKey("raw", await crypto.subtle.deriveBits({
50
+ const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveKey"]);
51
+ return crypto.subtle.deriveKey({
56
52
  name: "PBKDF2",
57
53
  salt,
58
- iterations: 100_000,
54
+ iterations: 100000,
59
55
  hash: "SHA-256"
60
- }, keyMaterial, 256), {
56
+ }, keyMaterial, {
61
57
  name: "AES-GCM",
62
58
  length: 256
63
59
  }, false, ["encrypt", "decrypt"]);
@@ -45,17 +45,13 @@ const getAccountPlatform = account => {
45
45
  // Derive a key generated with PBKDF2 that will be used for AES-GCM encryption
46
46
  const deriveKey = async (password, salt) => {
47
47
  // Deriving 32-byte key using PBKDF2 with 100000 iterations and SHA-256
48
- const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveBits"]);
49
-
50
- // NOTE: react-native-quick-crypto (our `global.crypto` polyfill on Talisman mobile) doesn't support `crypto.subtle.deriveKey`.
51
- // But, we can work around this by using `crypto.subtle.deriveBits` and `crypto.subtle.importKey`, which when used together
52
- // can provide the same functionality as `crypto.subtle.deriveKey`.
53
- return crypto.subtle.importKey("raw", await crypto.subtle.deriveBits({
48
+ const keyMaterial = await crypto.subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveKey"]);
49
+ return crypto.subtle.deriveKey({
54
50
  name: "PBKDF2",
55
51
  salt,
56
- iterations: 100_000,
52
+ iterations: 100000,
57
53
  hash: "SHA-256"
58
- }, keyMaterial, 256), {
54
+ }, keyMaterial, {
59
55
  name: "AES-GCM",
60
56
  length: 256
61
57
  }, false, ["encrypt", "decrypt"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/keyring",
3
- "version": "0.0.0-pr1866-20250409123927",
3
+ "version": "0.1.1",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",