{"_id":"blowfish-js","_rev":"1-a6ffe71d529a0f4dfca16c7e3cc5b231","name":"blowfish-js","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"blowfish-js","version":"1.0.0","description":"Pure Javascript implementation of Blowfish block cipher.","main":"blowfish.js","scripts":{"test":"node ./test/blowfish-test.js"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/rinne/node-blowfish-js.git"},"keywords":["cipher","encryption","decryption","security","ECB","CBC","CFB","OFB"],"author":{"name":"Timo J. Rinne","email":"tri@iki.fi","url":"https://github.com/rinne/"},"license":"GPL-2.0","bugs":{"url":"https://github.com/rinne/node-blowfish-js/issues"},"homepage":"https://github.com/rinne/node-blowfish-js#readme","gitHead":"d64dba4fded3f8f8d9a181eb718d901a421762c6","_id":"blowfish-js@1.0.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-lFtuQ5O5a3avy9qQxZKXnObkL1idVjAM2vNl0SUywzz/EpLJaeMC7Ob1NEmsCxbH2wi4cxrH0yTWbZT4X1TZkg==","shasum":"eb323ab3091a392cca041271f22c86b14583632b","tarball":"https://registry.npmjs.org/blowfish-js/-/blowfish-js-1.0.0.tgz","fileCount":5,"unpackedSize":48523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7+GSCRA9TVsSAnZWagAADl4P/jmFavszy+/7n49wCqmt\nk/JhoeTpW4/MzYyXxj/MIBjdUhGzMqTOj+d0A6o19jg02sMhwLGOQwnUibEZ\n7l0wuLkq6L6g1fprW9e94x53q+vLKWhgXR5DobHCotgt1Dox8NCKFfQZFs73\nuvg3sKfWypQGy5AcelefEz3+hPr/joTwz+Ekgrs5mg1slRAWs9/sXjYgLtv2\nlZhl3h1HpSRebVA5s/tstHhFCjAvZG7C2WOyfjl5ltPMx4i8xUeEUhAbohek\nFYGxQeVuapgYw0vtLzVrzbeW+rXwgYK84eiVHd2xAjGnjL0fj85d9AcB2qye\n6NYpYoBPfzzWw3BdjyRPN6i2LO+aZifFhkgsH+U1Xhrk1QojNX7ebcLIK3m8\npN+T41asToVmLX9nKuMRdixI9/8u7aylOSxCr6EqkFCjGiRzlsJh7LYHg1No\nP6hKKYs/0FCLCc5SUYLQgDuVUZIVyRflPUkJA9MPDwXNqM2rTS9Zx4OPXW1B\n6wgMD9HzuWw7UxTiWOj3qp4eWbKN2BVNEEZITNyM3UZg0kLGQWjkMBRnIAGk\nB9dpx0892BBgcGtOuz907XQq+pAFkJKrntP+1is0IZ2RPSjXbQC1jQUsqPZg\nTr23VjdzceGPaZu2C0EGiAUslD9uJtsMqRDuJm7IEl32avcUuYyn3xMBNr3I\nKM7r\r\n=xdpJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcmygH4h0F14UwhVuySaerrjADy2FmKYRflwarDS/r4wIgYhFbNcdOVoBJJ9Lqrw67aV+kEAOWccvg6499A3hpmSA="}]},"_npmUser":{"name":"rinne","email":"tri@iki.fi"},"directories":{},"maintainers":[{"name":"rinne","email":"tri@iki.fi"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blowfish-js_1.0.0_1643110801782_0.211937042039281"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-25T11:40:01.781Z","1.0.0":"2022-01-25T11:40:02.104Z","modified":"2022-04-12T03:47:16.898Z"},"maintainers":[{"name":"rinne","email":"tri@iki.fi"}],"description":"Pure Javascript implementation of Blowfish block cipher.","homepage":"https://github.com/rinne/node-blowfish-js#readme","keywords":["cipher","encryption","decryption","security","ECB","CBC","CFB","OFB"],"repository":{"type":"git","url":"git+https://github.com/rinne/node-blowfish-js.git"},"author":{"name":"Timo J. Rinne","email":"tri@iki.fi","url":"https://github.com/rinne/"},"bugs":{"url":"https://github.com/rinne/node-blowfish-js/issues"},"license":"GPL-2.0","readme":"In A Nutshell\n=============\n\nThis is a pure Javascript implementation of Blowfish symmetric block\ncipher algorithm.\n\n\nUsage\n=====\n\n```\nconst blf = require('./blowfish.js');\nconst crypto = require('crypto');\n{\n\tlet key = crypto.randomBytes(32);\n\tlet context = blf.key(key);\n\tlet plaintext = 'Length is divisible by 8 to match the block size';\n\tlet ciphertext = blf.ecb(context, Buffer.from(plaintext, 'utf8'));\n\tlet decrypted = blf.ecb(context, ciphertext, true);\n}\n{\n\tlet key = crypto.randomBytes(16);\n\tlet iv = crypto.randomBytes(8);\n\tlet context = blf.key(key);\n\tlet plaintext = 'CBC mode also requires full blocks. Pad input data if necessary.';\n\tlet ciphertext = blf.cbc(context, iv, Buffer.from(plaintext, 'utf8'));\n\tlet decrypted = blf.cbc(context, iv, ciphertext, true);\n}\n{\n\tlet key = crypto.randomBytes(16);\n\tlet iv = crypto.randomBytes(8);\n\tlet context = blf.key(key);\n\tlet plaintext = 'Same with CFB. Full blocks only!';\n\tlet ciphertext = blf.cfb(context, iv, Buffer.from(plaintext, 'utf8'));\n\tlet decrypted = blf.cfb(context, iv, ciphertext, true);\n}\n{\n\tlet key = crypto.randomBytes(16);\n\tlet iv = crypto.randomBytes(8);\n\tlet context = blf.key(key);\n\tlet plaintext = 'With OFB, input length can be anything, but remember to use a unique IV every time! Encryption and decryption are identical in this mode.';\n\tlet ciphertext = blf.ofb(context, iv, Buffer.from(plaintext, 'utf8'));\n\tlet decrypted = blf.ofb(context, iv, ciphertext, true);\n}\n```\n\n\nCompliance\n==========\n\nTest vectors are included into the package. Results of ecb, cbc, cfb,\nand ofb functions are identical to nodejs crypto subsystem cipher\nalgorithms bf-ecb, bf-cbc, bf-cfb, and bf-ofb respectively.\n\n\nAuthor\n======\n\nTimo J. Rinne <tri@iki.fi>\n\n\nLicense\n=======\n\nGPL-2.0\n","readmeFilename":"README.md"}