File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
apps/mobile/v1/src/lib/encryption/core Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 11/**
22 * Base Cryptographic Utilities
33 * Conversion and encoding helpers
4+ *
5+ * Note: All encoding/decoding is handled by node-forge utilities
6+ * to maintain compatibility with the web app implementation.
47 */
5-
6- export function stringToUint8Array ( str : string ) : Uint8Array {
7- const encoder = new TextEncoder ( ) ;
8- return encoder . encode ( str ) ;
9- }
Original file line number Diff line number Diff line change 55
66import forge from 'node-forge' ;
77import { ENCRYPTION_CONFIG } from '../config' ;
8- import { stringToUint8Array } from './crypto' ;
8+
99
1010/**
1111 * PBKDF2 implementation using node-forge to match web app
@@ -20,9 +20,8 @@ export async function pbkdf2(
2020 // Convert inputs to proper format to match web app
2121 const passwordBytes = forge . util . encodeUtf8 ( password ) ;
2222
23- // Convert salt string to bytes using TextEncoder equivalent
24- const saltUint8Array = stringToUint8Array ( salt ) ;
25- const saltBytes = forge . util . createBuffer ( saltUint8Array ) . data ;
23+ // Salt is already a string, use it directly
24+ const saltBytes = forge . util . encodeUtf8 ( salt ) ;
2625
2726 // Perform PBKDF2 computation (will block for ~2 minutes with 250k iterations)
2827 const derivedKey = forge . pkcs5 . pbkdf2 (
You can’t perform that action at this time.
0 commit comments