Lines Matching refs:salt
19 const salt = this.randomSalt();
20 const {hash, iv} = await this.derivePkdf2(password, salt, 'SHA-256', this.iterations);
27 return this.createOpenSSLCryptString(salt, new Uint8Array(cipher));
39 const {salt, cipher} = this.parseOpenSSLCryptString(ciphertext);
43 ({hash, iv} = this.deriveMd5(password, salt));
45 ({hash, iv} = await this.derivePkdf2(password, salt, 'SHA-256', this.iterations));
76 * Generate a random salt
88 * @return {{cipher: Uint8Array, salt: Uint8Array}}
98 salt: new Uint8Array(Array.from(ostring.slice(8, 16)).map(ch => ch.charCodeAt(0))),
106 * @param {Uint8Array} salt
110 createOpenSSLCryptString(salt, cipher) {
113 ...salt,
125 * @param {Uint8Array} salt The salt
131 async derivePkdf2(strPassword, salt, hash, iterations) {
139 salt: salt,
157 * @param {Uint8Array} salt The salt
161 deriveMd5(strPassword, salt) {
164 const D1 = md5.array(new Uint8Array([...password, ...salt]));
165 const D2 = md5.array(new Uint8Array([...D1, ...password, ...salt]));
166 const D3 = md5.array(new Uint8Array([...D2, ...password, ...salt]));