{"id":20578827,"url":"https://github.com/hydrocarbons/krypton","last_synced_at":"2026-04-20T02:35:56.980Z","repository":{"id":139598287,"uuid":"165317760","full_name":"HydroCarbons/krypton","owner":"HydroCarbons","description":"Krypton is a JavaScript class with Symmetric (asynchronous and synchronous) and Asymmetric encryption and decryption methods.","archived":false,"fork":false,"pushed_at":"2019-01-27T07:38:45.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T11:44:03.098Z","etag":null,"topics":["2019","adf","aes","asymmetric","asymmetric-cryptography","async","asynchronous","decryption","encryption","hydrocarbons","javascript","krypton","nodejs","rsa","secure","symmetric-key-cryptography","sync"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HydroCarbons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-11T22:10:57.000Z","updated_at":"2019-01-27T18:32:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cc2b874-a5ac-46c1-9afd-6678ef840971","html_url":"https://github.com/HydroCarbons/krypton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HydroCarbons/krypton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HydroCarbons%2Fkrypton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HydroCarbons%2Fkrypton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HydroCarbons%2Fkrypton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HydroCarbons%2Fkrypton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HydroCarbons","download_url":"https://codeload.github.com/HydroCarbons/krypton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HydroCarbons%2Fkrypton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32030262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["2019","adf","aes","asymmetric","asymmetric-cryptography","async","asynchronous","decryption","encryption","hydrocarbons","javascript","krypton","nodejs","rsa","secure","symmetric-key-cryptography","sync"],"created_at":"2024-11-16T06:14:41.441Z","updated_at":"2026-04-20T02:35:56.961Z","avatar_url":"https://github.com/HydroCarbons.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Krypton Icon](https://raw.githubusercontent.com/HydroCarbons/krypton/master/krypton-256.png)\n\n## Travis CI\n[![Build Status](https://travis-ci.com/HydroCarbons/krypton.svg?branch=master)](https://travis-ci.com/HydroCarbons/krypton)\n\n# Krypton\n- **Krypton** is a JavaScript class with Symmetric (asynchronous and synchronous) and Asymmetric encryption and decryption methods. **Cipher** is configured to use **AES-256-CBC** with initialization vector.\n\n## Usage\n\n### Install\n` npm install Krypton-js `\n\n### Require\n```javascript\nconst { Krypton } = require(\"krypton-js\")\n```\n### Create an instance of Krypton and pass encryptionFileName and Password\n```javascript\nlet Krypton = new Krypton(encryptionFileName, Password)\n```\n\n### Encrypt Synchronous\n```javascript\nKrypton.encrypt(data)\n```\n\n### Decrypt Synchronous\n```javascript\ndata = Krypton.decrypt()\n```\n\n### Encrypt Asynchronous\n```javascript\nKrypton.encryptAsync(data).then(result=\u003e{ ... })\n// Result = { message: \"Encrypted!\" }\n```\n\n### Decrypt Asynchronous\n```javascript\nKrypton.decryptAsync(data).then(decryptedData=\u003e{ ... })\n//\n```\n\n## Asymmetric Encryption/decryption\n\n### A exchanges its public key with B\n### A sends data to B, where encryption of data is done with A's Private Key\n```javascript\nencrypted_data = Krypton.encryptWithRSAPrivateKey( client_request, privateKey )\n```\n\n### B: data decryption with A's public Key\n```javascript\ndecrypted_data = Krypton.decryptWithRSAPublicKey(encrypted_data, pubKey)\n```\n### B to A, encryption with A's public Key\n```javascript\nencrypted_data = Krypton.encryptWithRSAPublicKey(server_response, pubKey)\n```\n\n### A: decryption with A's private Key\n```javascript\ndecrypted_data = Krypton.decryptWithRSAPrivateKey(encrypted_data, privateKey)\n```\n\n### Generate a public and private RSA key pair\n```javascript\n1. ssh-keygen -t rsa\n2. openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365\n```\n\n## Library Usage/Test\n### Try it out\n` npm install `\n\n### Test\n` npm run test `\n\n### Coverage\n` istanbul cover test `\n\nCheck coverage folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrocarbons%2Fkrypton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhydrocarbons%2Fkrypton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrocarbons%2Fkrypton/lists"}