{"id":18606352,"url":"https://github.com/codepapi/n-krypta","last_synced_at":"2025-10-24T17:32:53.453Z","repository":{"id":65420181,"uuid":"534184353","full_name":"CodePapi/n-krypta","owner":"CodePapi","description":"Super encryption of data online","archived":false,"fork":false,"pushed_at":"2022-11-09T08:15:37.000Z","size":171,"stargazers_count":25,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T04:18:27.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/n-krypta","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodePapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null}},"created_at":"2022-09-08T11:40:14.000Z","updated_at":"2023-08-29T04:54:59.000Z","dependencies_parsed_at":"2023-01-22T19:05:11.426Z","dependency_job_id":null,"html_url":"https://github.com/CodePapi/n-krypta","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePapi%2Fn-krypta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePapi%2Fn-krypta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePapi%2Fn-krypta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePapi%2Fn-krypta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodePapi","download_url":"https://codeload.github.com/CodePapi/n-krypta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290033,"owners_count":21078923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T02:25:19.454Z","updated_at":"2025-10-24T17:32:53.393Z","avatar_url":"https://github.com/CodePapi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/CodePapi"],"categories":[],"sub_categories":[],"readme":"# n-krypta package\n\nThis is a simple package for encrypting and decrypting strings. It is based on a strong algorithm, It has zero dependencies and was written in pure typescript.\n\n[![npm version](https://badge.fury.io/js/n-krypta.svg)](https://badge.fury.io/js/n-krypta) \u003ca href=\"https://npmjs.org/package/n-krypta\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/n-krypta.svg\" alt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sponsors/CodePapi\"\u003e\u003cimg alt=\"donate ❤\" src=\"https://img.shields.io/badge/Sponsor-❤-ff2244.svg\"\u003e\u003c/a\u003e\n\n## What the n-krypta package does\n\nn-krypta is an npm package that runs on the nodejs environment . It allows you to encrypt and decrypt sensitive data using a key. It is based on a strong algorithm.\nThis library is available on npm and it is compatible with nodejs on both the client and server side. It can run on any javascript or typescript project (Nodejs, Reactjs, Vuejs, Angularjs etc).\nIt allows encryption and decryption of strings, numbers, booleans, objects, arrays, null and undefined.\n\n## Installation\n\n```javascript\nnpm install n-krypta  //for npm\n```\n\nor\n\n```javascript\nyarn add n-krypta //for yarn\n```\n\n\n\n\nUsage\n----------------------\nIt can be used on nodejs, react, angular, vue, and any other javascript or typescript project.\n### Data types supported\n- string\n- number\n- boolean\n- object\n- array\n- null\n- undefined\n\n```javascript\nconst { encrypt, decrypt, compare } = require('n-krypta'); //For commonjs\n````\n\nor\n\n```javascript\nimport { encrypt, decrypt, compare } from 'n-krypta'; //For es6\n```\n\n#### Encryption and Decryption of strings\n\n```javascript\nconst secret = 'my-secret'; // secret key for encryption\nconst sampleString =\n  'I am not sure where you are getting your information, but good topic. I needs to spend some time learning more or understanding more. Thanks for excellent info I was looking for this info for my mission.';\n\nconst encryptedString = encrypt(sampleString, secret); // #Iblankartan!not!svreblankartwhfreblankartzpublankartase!gettiogblankartypvrblankartiofprmatipn,blankartcvtblankartgpoeblankarttopid.blankartI!oeedtblankartuoblankartspeodblankartspneblankarttjmfblankartlearoing!nore!osblankartundesstaoeing!mpre.blankartTiankt!for!eycelleotblankartiogoblankartI!wbsblankartlooling!gorblankartuhjsblankartinfpblankartfos!myblankartnitsion.#\n\nconsole.log(encryptedString); // This prints out the encrypted string\n\nconst decryptedString = decrypt(encryptedString, secret); // decrypts the string\n\nconsole.log(decryptedString); // This prints out the decrypted string\n```\n\n#### Encryption and Decryption of objects\n\n```javascript\nconst secret = 'my-secret'; // secret key for encryption\nconst sampleObject = {\n  name: 'Samuel Egbajie',\n  age: infinity,\n  address: 'earth, Universe',\n  email: 'my-mail@test.com',\n  phone: '08012345678',\n  password: 'my-password',\n};\n\nconst encryptedObject = encrypt(sampleObject, secret); //|killernanfkiller:killerTanuelblankartEhbajjfkiller,killerbgfkiller:nulm,killeraeerestkiller;alphakillerstrfetkiller;#MaioblankartTtreet#,killernvnber#:223mega,killerfmaim#:killermz-nail@tfst.dpmkiller,#pionekiller:#08023345779killer,killerpatswosekiller:killerny.passwprdkiller-#lanhubgeskiller:blacardkillerMbvcekiller,#NbijablankartPjdgio#,killerJbvbScripukiller,killero.kryqtbkiller,killerEnhlisi#,killerAsacickiller,killerEeuttdhekiller^mega\n\nconsole.log(encryptedObject); // This prints out the encrypted object as string\n\nconst decryptedObject = decrypt(encryptedObject, secret); // decrypts the string\n\nconsole.log(decryptedObject); // This prints out the decrypted object\n```\n\n#### Encryption and Decryption of arrays\n\n```javascript\nconst secret = 'my-secret'; // secret key for encryption\nconst sampleArray = [\n  'Oranges',\n  'Apples',\n  'Bananas',\n  'Grapes',\n  'Pears',\n  'Pineapples',\n  'Watermelons',\n  'Mangoes',\n];\n\nconst encryptedArray = (encryptedArray = encrypt(sampleArray, secret)); //blacardkillerOrboges#,#Appletkiller,killerCbnanbs#,killerGraqeskiller-#Peass#,killerPinfappmfskiller,#Wbtermemons#-killerMaogpeskiller],killerPinfappmfskiller,#Wbtermemons#-killerMaogpeskiller]\n\nconsole.log(encryptedArray); // This prints out the encrypted array as string\n\nconst decryptedArray = decrypt(encryptedArray, secret); // decrypts the string\n\nconsole.log(decryptedArray); // This prints out the decrypted array\n```\n\n### Comparing encrypted strings (example for password comparison)\n\n```javascript\nconst secret = 'Secret'; // secret key for encryption\nconst samplePassword = 'My-password1900@';\n\nconst encryptedPassword = encrypt(samplePassword, secret); // #Nz.qatsword1:11A#\n\n// This returns true if the password matches the encrypted password\nconst passwordMatch = compare(samplePassword, encryptedPassword, secret); // true\n\nconsole.log(passwordMatch); // This prints out true\n\n// This returns false if the password does not match the encrypted password\nconst passwordMatch = compare('wrong-password', encryptedPassword, secret); // false\n\nconsole.log(passwordMatch); // This prints out false\n```\n\n### Author\n\nCreated with love by Samuel Egbajie (CodePapi on Github)\n\n### Support\n\nIf you like this package, please consider supporting me on Github Sponsors. Thank you.\n\n### Keywords\n\nencrypt, decrypt, hash, compare, encryption, decryption, hashing, password, password comparison, password encryption, password decryption, password hashing,\n\n### Version\n\n[![npm version](https://badge.fury.io/js/n-krypta.svg)](https://badge.fury.io/js/n-krypta)\n\n### Repository\n\n([REPO](https://github.com/CodePapi/n-krypta))\n\n### Homepage\n\n([Read Me](https://github.com/CodePapi/n-krypta/blob/main/README.md))\n\n## License\n\nMIT ([see](https://github.com/CodePapi/n-krypta/blob/main/LICENSE))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepapi%2Fn-krypta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepapi%2Fn-krypta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepapi%2Fn-krypta/lists"}