browserify / crypto-browserify

partial implementation of node's `crypto` for the browser
MIT License
654 stars 200 forks source link

Blowfish support #188

Open sayem314 opened 5 years ago

sayem314 commented 5 years ago

How do I do this?

const decryptChunk = (chunk, blowFishKey) => {
  let cipher = crypto.createDecipheriv('bf-cbc', blowFishKey, Buffer.from([0, 1, 2, 3, 4, 5, 6, 7]));
  cipher.setAutoPadding(false);
  return cipher.update(chunk, 'binary', 'binary') + cipher.final();
}
rawr51919 commented 3 years ago

This could be added onto via the use of a JS Blowfish module and a PR. I'll see if there's any that might do the job here.

rawr51919 commented 3 years ago

Seeing how the repo is implemented, though, it'd require a polyfill for your usage case