{"_id":"ubiq-security-fpe","_rev":"2-ad885d11da87b4d358bba64828bb2422","name":"ubiq-security-fpe","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"ubiq-security-fpe","version":"1.0.0","description":"Ubiq Security, Inc. Format Preserving Encryption functions","main":"index.js","author":{"name":"Ubiq Security, Inc.","email":"support@ubiqsecurity.com","url":"https://www.ubiqsecurity.com/"},"license":"MIT","keywords":["ubiq security","ubiq","security","encryption","client","FPE","FF1","Format Preserving Encryption"],"dependencies":{"big-integer":"^1.6.51"},"devDependencies":{"eslint":"^7.32.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.25.4","jest":"^27.5.1"},"scripts":{"test":"jest"},"engines":{"node":">=12.0.0","npm":">=6.0.0"},"repository":{"type":"git","url":"git+https://gitlab.com/ubiqsecurity/ubiq-fpe-node.git"},"homepage":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node","gitHead":"b306238b1d9194ac64bc984d44a2cd15249c3cb1","bugs":{"url":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node/issues"},"_id":"ubiq-security-fpe@1.0.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-hPmEemKK1x5PG7qmrsMzlSwDFCxmPRLWwvzI2gNC6PltDGlOKze6aJtkbzYdnEUdx4iTooGAvs6wADlJlfCwVQ==","shasum":"1c851852b1581d916841684294306b3ec6620f25","tarball":"https://registry.npmjs.org/ubiq-security-fpe/-/ubiq-security-fpe-1.0.0.tgz","fileCount":12,"unpackedSize":28779,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCptQpmrySQ2e4wMg6XI8MmPnWIabqt0WRX54/lvzfzYwIhANEtgxNpYlJl3zJBwn7ZwtAvn1rLD6fqZZHDq7uIF1ox"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitgnxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoA9A/9Habk6dzC++4Se/i1e5PCxYB+v2YJXjO4TZZT21/0tPByzFxo\r\nu+ddgNjLrVXVyjiHbfLs7lr5rDYGSLeitEXH9LlZaTa13Edn5vN7ruOj9Obr\r\n3c/+76p9/tR4m1WFQmh8G80f5Mgc0Ro6NDMqJT1U5XO2H0dgtnBO0IIZYUMP\r\nIE1M64WvX0UMwRR11jmwWud+6OdnlPZmw9j6oBAADq5vA/KLmVX2ZR7n/zDk\r\nSZZSy/piHZkGAT3lPniP956PCPEM/o3l7Jy9gpcBdwTY4PXIlBLKvs5E7qs+\r\nOzVXn2rvepup79G0YHIHZgG/SoTOfcwWfHNPR2Urd5q1syV0tDBUlh8mOxCC\r\nX3lH+90NiFnYpiB+U2FwI3BcvQ3nVOsK6TK9k+AfC2VN5EgLIvEuzmEPv1UA\r\njA4UiqgGCcGOR26HxCA5ND4jRKahofZ+b/q5c6iZCGdxEQ7dxigS33GFAM4Y\r\nTD4BJqYUudX9Iax3lgJ5jgEPI639Ef0M+QY5Q5exiOkqpb1n2luFD5wsaPvV\r\nIL4l/p9uia6XEk3r8tMDssajVqCykg95K20PQvXxkxnuoIJmjeisY71Lemd+\r\naOWooD0pm1kBmx8VNNU5jXQMXQIvL2PqMdtye0Hjg6L4nzKwq6ysDO0AKXpG\r\nUae/r6BTvShtdY3S+VtDGDzCvHo/+qsvq00=\r\n=J9iR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"garyschneir","email":"gary@ubiqsecurity.com"},"directories":{},"maintainers":[{"name":"garyschneir","email":"gary@ubiqsecurity.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ubiq-security-fpe_1.0.0_1656097265218_0.2954878007429884"},"_hasShrinkwrap":false},"1.0.1":{"name":"ubiq-security-fpe","version":"1.0.1","description":"Ubiq Security, Inc. Format Preserving Encryption functions","main":"index.js","author":{"name":"Ubiq Security, Inc.","email":"support@ubiqsecurity.com","url":"https://www.ubiqsecurity.com/"},"license":"MIT","keywords":["ubiq security","ubiq","security","encryption","client","FPE","FF1","Format Preserving Encryption"],"dependencies":{"big-integer":"^1.6.51"},"devDependencies":{"eslint":"^7.32.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.25.4","jest":"^27.5.1"},"scripts":{"test":"jest"},"engines":{"node":">=12.0.0","npm":">=6.0.0"},"repository":{"type":"git","url":"git+https://gitlab.com/ubiqsecurity/ubiq-fpe-node.git"},"homepage":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node","gitHead":"6876899ba052403044f06e4fdabf3fa2c12715bf","bugs":{"url":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node/issues"},"_id":"ubiq-security-fpe@1.0.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-+Un7p/bndcepZeDaKg33FX9hzzs2Lo/JmKcT8fx8/vTcjSGj/+4tLIavs8ll778zZl4k5EcbMtlyK3Ch2OEApA==","shasum":"f24c92c8756a4b5fb3356ea56b3e57a8fd66a0e0","tarball":"https://registry.npmjs.org/ubiq-security-fpe/-/ubiq-security-fpe-1.0.1.tgz","fileCount":12,"unpackedSize":28824,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEnnMTHv9oGQgDcGJMvwljo97xqNngCH9rOaEiADcbhwIhAKDwBGdsKENeLeeswdI6bFGqgaPx1DZo1BLjzk9HnuJz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitguAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmopbg/9ESEfEm33T9CdAzoA5EUs9x/qk6wuG3x/1XqUhwjSHZeadEv3\r\nXdsjj48rI1V/63L2vczA3wq+a7pH4gVcuO5qubbIC36+Ov4OMHHXTxwA6F7P\r\nCk4uKz53oRDBcS8pyyeoZSrMrNQR8OjK0ybcWIgBC3Qgta3WmUj7BtgheYKt\r\nspVtfIox/prKcbgdWWQzHEBJ1aDFJM77TSgtSFAyhK4LvedQutyCv/gK8meD\r\nZpz3yHsxrIsfxUjyvdSKqSwvM0RGDqvhT7O3pxHxHHnUM4xp7FzRBkLhHBhA\r\nUXErvess6lbG75frw8PEO6mr7iLG532Z2Uy25KQjyN+YTKlmh7eJSRmxVaHC\r\npH1YhF5PRvNENmNMIl3OqHZWFniVr1u/rqLP2UHUyqsYlwY2jOIyZZfGCJRb\r\nwfvSWsNaeDgYsz62sEt4BFWC1EGSerjdFPzg7YoMIsiGKWtYB5RprEeoslq7\r\nhyj0wZ14cBXC+QF4m6rLJDnkt135ref2cY3A0rI4D20s6nmMUnQP7YvgDPa1\r\nBbFSqSVDJZ/nv65tVC7ggY8Z+NJ1nbVX93yKilbBgARYM0lydyxAMVvy3efO\r\nYD15zclRDasTr9d6Xscm6iDPSQoSzy44MZoiD6CWxsgAuFg/lR319csXiPkH\r\nhrDbMLt3bngfg0Hyw8TdROLr727vswWE0zc=\r\n=eqk4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"garyschneir","email":"gary@ubiqsecurity.com"},"directories":{},"maintainers":[{"name":"garyschneir","email":"gary@ubiqsecurity.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ubiq-security-fpe_1.0.1_1656097664241_0.2526713049796161"},"_hasShrinkwrap":false},"2.0.0":{"name":"ubiq-security-fpe","version":"2.0.0","description":"Ubiq Security, Inc. Format Preserving Encryption functions","main":"index.js","author":{"name":"Ubiq Security, Inc.","email":"support@ubiqsecurity.com","url":"https://www.ubiqsecurity.com/"},"license":"MIT","keywords":["ubiq security","ubiq","security","encryption","client","FPE","FF1","Format Preserving Encryption"],"dependencies":{"big-integer":"^1.6.51"},"devDependencies":{"eslint":"^7.32.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.25.4","jest":"^27.5.1"},"scripts":{"test":"jest"},"engines":{"node":">=12.0.0","npm":">=6.0.0"},"repository":{"type":"git","url":"git+https://gitlab.com/ubiqsecurity/ubiq-fpe-node.git"},"homepage":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node","gitHead":"e7b8233542e41a550b080df3fded4668418c947d","bugs":{"url":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node/issues"},"_id":"ubiq-security-fpe@2.0.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-c1WhOmNQmCtz/KOLF7XmFDXK2Vaz2YoFdYtca/+W8Z20jT9+fo5LmMRvIK123cYLNMjoxDwfQQQSx6VF0lGDBQ==","shasum":"75e6e29eee97db8ca48c83448630115ce13c362b","tarball":"https://registry.npmjs.org/ubiq-security-fpe/-/ubiq-security-fpe-2.0.0.tgz","fileCount":12,"unpackedSize":28918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5kHc7Z0qHjQKJot2RwcRh5XsNeFEawt3wbnRsTDsWZAiEAlv13sTLjKKmPoojrv+TReAa7CSS8ETALaS4AWgju4iU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRogIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBng/9Hbvvn70H/nJ+La92Hy0NmX391HAlrlwwY2GrjVlaqQYTHkBa\r\nUVPfiRLrLTLu+mxsc5bK5YVIyn/GiiqgXAxGvXEdh93xvQyArp9I1U1HKgUk\r\nJLaL60hNuH2Yyqz3RLPuV+IT77gMF+ytY/ayvgYEfCF8Nioinrv6KhdjCaly\r\nL4eUZ8q23uS802LyzDwzaLnmzftuXWJ+z4f2CTzx0z5yzLMJrKSY1oMH01eN\r\nPDjVL/u1O6GRW0/FJ45Ura7xa5XfHO7xq5fbW2R0ACRz3NEUQ+hjv+gq9ezk\r\nJGXHsHI3d4paiGvOdAigpBUDHFVey93QjyoD4N4gWznZ92Y5wKFNOijwOx2m\r\nyE+Dfyfzn5QQOtCcaxbeMlg6Zmrl3lryhTaJf1CDtT7gxZuQTg4YxEoMvPzV\r\nyNSXmd4G4Bq+YOo7ZB031wQWGWYk37cps4eFD87saTkavV89bz167rxk73Op\r\njBG3rTy79lixqSHey+XrJ9LMDW4G6rWTqWuLvC5DRFRbifzmm7yRZvbU8NlH\r\nBDJYkUHl3NPl7RqxyXKcYSXLoljEwBJMy2bPxKUy9bFcR2S71apOHwoMXY6D\r\n99PoswW//aDfFAb/bCpdCXaGJshosywgCnRy58yED+RUuc5EfqjzSSMvIrWh\r\nYQW7s0/FAVDLMeXmWeTdDzdrvkFjxXHqt+M=\r\n=uJm4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"garyschneir","email":"gary@ubiqsecurity.com"},"directories":{},"maintainers":[{"name":"garyschneir","email":"gary@ubiqsecurity.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ubiq-security-fpe_2.0.0_1682343943972_0.8472502507745485"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-24T19:01:05.217Z","1.0.0":"2022-06-24T19:01:05.415Z","modified":"2023-04-24T13:45:44.292Z","1.0.1":"2022-06-24T19:07:44.453Z","2.0.0":"2023-04-24T13:45:44.174Z"},"maintainers":[{"name":"garyschneir","email":"gary@ubiqsecurity.com"}],"description":"Ubiq Security, Inc. Format Preserving Encryption functions","homepage":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node","keywords":["ubiq security","ubiq","security","encryption","client","FPE","FF1","Format Preserving Encryption"],"repository":{"type":"git","url":"git+https://gitlab.com/ubiqsecurity/ubiq-fpe-node.git"},"author":{"name":"Ubiq Security, Inc.","email":"support@ubiqsecurity.com","url":"https://www.ubiqsecurity.com/"},"bugs":{"url":"https://gitlab.com/ubiqsecurity/ubiq-fpe-node/issues"},"license":"MIT","readme":"# Format Preserving Encryption in Node\n\nAn implementation of the NIST-approved FF1 and FF3-1 algorithms in Node.\n\nThis implementation conforms (as best as possible) to\n[Draft SP 800-38G Rev. 1][800-38g1]. The implementation passes all tests\nspecified by NIST in their Cryptographic Standards and Guidelines\n[examples for FF1][ff1-examples]; however, no official examples/samples exist\n(or are known) for FF3-1. FF3 is not implemented as NIST has officially\ndeprecated its use in light of recent [cryptanalysis][ff3-cryptanalysis]\nperformed on it.\n\n\n## Installation\n\n#### Using the npm or yarn package managers:\nYou may want to make sure you are running the latest version of npm or yarn by first executing\n```sh\n$ npm install -g npm\n# or\n$ npm install -g yarn\n```\n\nInstall the ubiq-security-fpe package with:\n\n```sh\n$ npm install ubiq-security-fpe\n# or\n$ yarn add ubiq-security-fpe\n```\n\nTo build and install directly from a clone of the gitlab repository source:\n\n```sh\n$ git clone git@gitlab.com:ubiqsecurity/ubiq-fpe-node.git\n$ cd ubiq-node-fpe\n$ npm install\n```\n\n### Requirements\n\nNode.js version 12 or later\nnpm version 6 or later\n\nAll dependencies are pre-required in the module itself.\n\n\n\n\n# Testing\n\nTo run the tests:\n```sh\n$ npm run test\n```\n\nAs described above, the unit tests for FF1 come from the NIST guidelines. As\nno such guidelines are available for FF3-1, the unit tests verify only that\nthe encryption and decryption implementations are compatible with each other.\n\n# Documentation\n\nSee the [Node API docs][apidocs].\n\n\n\n\n### About alphabets and the radix parameter\n\nThe interfaces operate on strings, and the radix parameter determines which\ncharacters are valid within those strings, i.e. the alphabet. For example, if\nyour radix is 10, then the alphabet for your plain text consists of the\ncharacters in the string \"0123456789\". If your radix is 16, then the\nalphabet is the characters in the string \"0123456789abcdef\".\n\nA radix of up to 255 is supported, and the alphabet for a radix of 36 is\n\"0123456789abcdefghijklmnopqrstuvwxyz\".\n\n### Tweaks\n\nTweaks are very much like Initialization Vectors (IVs) in \"traditional\"\nencryption algorithms. For FF1, the minimun and maximum allowed lengths of\nthe tweak may be specified by the user, and any tweak length between those\nvalues may be used. For FF3-1, the size of the tweak is fixed at 7 bytes.\n\n### Plain/ciphertext input lengths\n\nFor both FF1 and FF3-1, the minimum length is determined by the inequality:\n- radix<sup>minlen</sup> >= 1000000\n\nor:\n- minlen >= 6 / log<sub>10</sub> radix\n\nThus, the minimum length is determined by the radix and is automatically\ncalculated from it.\n\nFor FF1, the maximum input length is\n- 2<sup>32</sup>\n\nFor FF3-1, the maximum input length is\n- 2 * log<sub>radix</sub> 2<sup>96</sup>\n\nor:\n- 192 / log<sub>2</sub> radix\n\n## Examples\n\nThe [unit test code](test) provides the best and simplest example of how to use the\ninterfaces.\n\n\n### FF1\n```javascript\n   /*\n     * @key is an array of bytes which must be 16, 24, or 32 long\n     * @twk is an array of bytes of which must be between @twkmin\n     *     and @twkmax lengths passed in. \n     * @custom_radix_str is the custom radix string indicating valid\n     *     characters allowed by @PT and @encrypted_text.  In this\n     *     case, Radix 10 (numeric) is being used.\n     * \n     * @PT is \"user input\" for the data being encrypted\n     */\n\n    const custom_radix_str = \"0123456789\"\n\n    const ctx = new FF1(key, twk, twkmin, twkmax, custom_radix_str.length, custom_radix_str);\n    const cipher_text = ctx.encrypt(PT);\n    const decrypted_text = ctx.decrypt(cipher_text);\n```\n\n[800-38g1]:https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38Gr1-draft.pdf\n[ff1-examples]:https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/FF1samples.pdf\n[ff3-cryptanalysis]:https://csrc.nist.gov/News/2017/Recent-Cryptanalysis-of-FF3\n[dashboard]:https://dashboard.ubiqsecurity.com\n[credentials]:https://dev.ubiqsecurity.com/docs/how-to-create-api-keys\n[apidocs]:https://dev.ubiqsecurity.com/docs/api\n\n","readmeFilename":"README.md"}