Skip to content

Commit

Permalink
remove hard coded hashes in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenbitbyte committed Apr 23, 2023
1 parent 439e13f commit 3a7a48a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions examples/example-password-argon2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ let dataparty_crypto = require('../dist/dataparty-crypto.js')
async function main (){

const password = 'super-strong-password'
//const salt = await dataparty_crypto.Routines.generateSalt()
const salt = Buffer.from('26bd99303dee4ee53342e89bd9f01a80c1fecf0d6b0c6c8eefee5a1eeeb8a0ec', 'hex') //! Salt would be read from disk after 1st run
const salt = await dataparty_crypto.Routines.generateSalt() //! Salt would be read from disk after 1st run

console.log('salt')
console.log('\t', salt.toString('hex'))
Expand Down
3 changes: 1 addition & 2 deletions examples/example-password-pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ let dataparty_crypto = require('../dist/dataparty-crypto.js')
async function main (){

const password = 'super-strong-password'
const salt = await dataparty_crypto.Routines.generateSalt()
//const salt = Buffer.from('60312b38547ee7141c0f3d79df97663a1e746313e3c3c3d414436b1fc78552d9', 'hex') //! Salt would be read from disk after 1st run
const salt = await dataparty_crypto.Routines.generateSalt() //! Salt would be read from disk after 1st run

console.log('salt')
console.log('\t', salt.toString('hex'))
Expand Down
7 changes: 2 additions & 5 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

const password = 'super-strong-password'
const salt = await dataparty_crypto.Routines.generateSalt()
//const salt = Buffer.from('60312b38547ee7141c0f3d79df97663a1e746313e3c3c3d414436b1fc78552d9', 'hex')

console.log('salt')
console.log('\t', salt.toString('hex'))
Expand Down Expand Up @@ -103,10 +102,8 @@
Uint8Array.from(hexString.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));


//const salt = await dataparty_crypto.Routines.generateSalt()
const salt = await dataparty_crypto.Routines.generateSalt()


const salt = fromHexString('26bd99303dee4ee53342e89bd9f01a80c1fecf0d6b0c6c8eefee5a1eeeb8a0ec')


console.log('\t','salt', salt.toString('hex'))
Expand Down Expand Up @@ -135,4 +132,4 @@

</script>
</body>
</html>
</html>

0 comments on commit 3a7a48a

Please sign in to comment.