{"id":29907226,"url":"https://github.com/sabkat-ahmed-rafi/cryptonism","last_synced_at":"2026-02-07T09:31:11.996Z","repository":{"id":306483752,"uuid":"1026350394","full_name":"sabkat-ahmed-rafi/cryptonism","owner":"sabkat-ahmed-rafi","description":"End-to-end encryption library for browser to secure authentication and sensitive data with zero-knowledge architecture.","archived":false,"fork":false,"pushed_at":"2025-07-31T16:00:04.000Z","size":225,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T20:42:39.515Z","etag":null,"topics":["aes-gcm-encryption","argon2","argon2-browser","browser-crypto","end-to-end-encryption","zero-knowledge"],"latest_commit_sha":null,"homepage":"https://cryptonism.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sabkat-ahmed-rafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-25T18:23:57.000Z","updated_at":"2025-08-01T11:32:41.000Z","dependencies_parsed_at":"2025-07-26T01:27:07.693Z","dependency_job_id":"2006c616-7ac1-4710-8b04-aa705b3c1622","html_url":"https://github.com/sabkat-ahmed-rafi/cryptonism","commit_stats":null,"previous_names":["sabkat-ahmed-rafi/cryptonism"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sabkat-ahmed-rafi/cryptonism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabkat-ahmed-rafi%2Fcryptonism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabkat-ahmed-rafi%2Fcryptonism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabkat-ahmed-rafi%2Fcryptonism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabkat-ahmed-rafi%2Fcryptonism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sabkat-ahmed-rafi","download_url":"https://codeload.github.com/sabkat-ahmed-rafi/cryptonism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabkat-ahmed-rafi%2Fcryptonism/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29191387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aes-gcm-encryption","argon2","argon2-browser","browser-crypto","end-to-end-encryption","zero-knowledge"],"created_at":"2025-08-01T22:07:54.513Z","updated_at":"2026-02-07T09:31:11.956Z","avatar_url":"https://github.com/sabkat-ahmed-rafi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Cryptonism \u0026middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sabkat-ahmed-rafi/cryptonism/blob/main/LICENSE)\n\n**Frontend End-to-End Encryption Library**  \nSecure your authentication flows and sensitive data with zero-knowledge architecture directly in the browser.\n\n---\n\n## ✨ Features\n\n- 🔑 Argon2id Key Derivation: Memory-hard password hashing resistant to attacks\n- 🔐 AES-GCM Encryption: Authenticated encryption for maximum security\n- 🛡️ Recovery System: Secure mnemonic-based key recovery\n- 🔄 Password Rotation: Safe password updates without data loss\n- 📊 Attempt Tracking: Built-in protection against brute force attacks\n- ⚡ TypeScript Support: Full type safety and IntelliSense support\n\n---\n\n## 📚 Documentation\nFull documentation is available here: [View the Docs](https://cryptonism.vercel.app)\n\n## 📦 Installation\n\n```bash\nnpm install cryptonism\n```\n\n## Usage Example\n\n### Encrypt An Account\n\n```typescript\nimport { generateEncryptedKey } from 'cryptonism';\n\nconst result = await generateEncryptedKey({\n  password: 'user-master-password'\n});\n\nif (result.success) {\n  // Store these in your database\n  const data = {\n    encryptedKey: result.encryptedKey,\n    salt: result.salt,\n    iv: result.iv,\n    encryptedRecoveryKey: result.encryptedRecoveryKey,\n    recoverySalt: result.recoverySalt,\n    recoveryIV: result.recoveryIV\n  };\n  \n  // CRITICAL: Show recovery phrase to user ONCE\n  alert(`Save this recovery phrase: ${result.recoveryPhrase}`);\n  \n} else {\n  console.error('Key generation failed:', result.error.message);\n}\n```\n\n### With Custom Argon2 Configuration\n\n```typescript\n// Note: use same custom argonConfig for all functions\nconst result = await generateEncryptedKey({\n  password: 'user-master-password',\n  argonConfig: {\n    time: 3,      // More iterations for higher security\n    mem: 32000,  // 32MB memory usage\n    hashLen: 32   // 32-byte output\n  }\n});\n\n// The Default Argon2 Config\nconst defaultArgonConfig = {\n  time: 3,\n  mem: 65536,\n  hashLen: 32\n};\n\n```\n\n### Decrypt An Account\n\n```typescript\nimport { decryptGeneratedKey } from 'cryptonism';\n\n// Data from your database\nconst data = {\n  salt: 'base64-salt-string',\n  iv: 'base64-iv-string', \n  encryptedKey: 'base64-encrypted-key'\n};\n\nconst result = await decryptGeneratedKey({\n  salt: data.salt,\n  iv: data.iv,\n  encryptedKey: data.encryptedKey,\n  password: 'user-entered-password'\n});\n\nif (result.success) {\n  const { decryptedKey } = result;\n  // Now you can use this key to encrypt/decrypt secrets\n  console.log('Vault unlocked successfully!');\n} else {\n  console.error('Failed to unlock vault:', result.error.message);\n}\n```\n\n### Decrypt With Attempt Tracking\n\n```typescript\nconst result = await decryptGeneratedKey({\n  salt: data.salt,\n  iv: data.iv,\n  encryptedKey: data.encryptedKey,\n  password: userPassword,\n  trackAttempts: {\n    enable: true,\n    id: `user-${userId}`,     // Unique identifier for this user\n    maxAttempts: 5            // Lock after 5 failed attempts\n  }\n});\n\nif (result.success) {\n  console.log('Login successful!');\n} else {\n  console.error(`Login failed. Attempts: ${result.attempts}/5`);\n  \n  if (result.attempts \u003e= 5) {\n    console.error('Account locked due to too many failed attempts');\n  }\n}\n```\n\n### Encrypt Each Secret Data\n\n```typescript\nimport { encryptSecret } from 'cryptonism';\n\n// Assuming you have a decrypted key from decryptGeneratedKey\nconst result = await encryptSecret({\n  secret: 'my-api-key-abc123',\n  decryptedKey: userDecryptedKey\n});\n\nif (result.success) {\n  // Store these values in your database\n  const secretRecord = {\n    encryptedSecret: result.encryptedSecret,\n    iv: result.iv,\n  };\n  \n  await saveSecretToDatabase(secretRecord);\n  console.log('Secret encrypted and saved!');\n} else {\n  console.error('Encryption failed:', result.error.message);\n}\n```\n\n### Decrypt Each Secret\n\n```typescript\nimport { decryptSecret } from 'cryptonism';\n\n// Data retrieved from your database\nconst secretRecord = {\n  encryptedSecret: 'base64-encrypted-data',\n  iv: 'base64-iv-string'\n};\n\nconst result = await decryptSecret({\n  encryptedSecret: secretRecord.encryptedSecret,\n  iv: secretRecord.iv,\n  decryptedKey: userDecryptedKey  // From decryptGeneratedKey\n});\n\nif (result.success) {\n  console.log('Secret:', result.decryptedSecret);\n  // Use the decrypted secret (API key, password, etc.)\n} else {\n  console.error('Decryption failed:', result.error.message);\n}\n```\n\n\nFor advanced usage, configuration options, and troubleshooting tips, please refer to the [Full Documentation](https://cryptonism.vercel.app).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabkat-ahmed-rafi%2Fcryptonism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabkat-ahmed-rafi%2Fcryptonism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabkat-ahmed-rafi%2Fcryptonism/lists"}