{"id":21394000,"url":"https://github.com/friday2su/cryptoflow","last_synced_at":"2025-03-16T14:21:52.697Z","repository":{"id":263784419,"uuid":"891372038","full_name":"friday2su/cryptoflow","owner":"friday2su","description":"A powerful and easy-to-use encryption and encoding library with zero dependencies","archived":false,"fork":false,"pushed_at":"2024-11-20T08:11:41.000Z","size":9762,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T01:41:58.241Z","etag":null,"topics":["aes","base64","crypto","encoding","encoding-decoding","encryption","hash","rsa","zero-dependencies"],"latest_commit_sha":null,"homepage":"","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/friday2su.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":"2024-11-20T08:07:58.000Z","updated_at":"2024-11-22T04:10:34.000Z","dependencies_parsed_at":"2024-11-20T11:10:06.451Z","dependency_job_id":null,"html_url":"https://github.com/friday2su/cryptoflow","commit_stats":null,"previous_names":["friday2su/cryptoflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friday2su%2Fcryptoflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friday2su%2Fcryptoflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friday2su%2Fcryptoflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friday2su%2Fcryptoflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friday2su","download_url":"https://codeload.github.com/friday2su/cryptoflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878644,"owners_count":20362467,"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":["aes","base64","crypto","encoding","encoding-decoding","encryption","hash","rsa","zero-dependencies"],"created_at":"2024-11-22T14:14:00.741Z","updated_at":"2025-03-16T14:21:52.661Z","avatar_url":"https://github.com/friday2su.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoFlow\n\nA powerful, zero-dependency cryptographic library for Node.js, providing military-grade encryption and comprehensive cryptographic operations with TypeScript support.\n\n[![npm version](https://badge.fury.io/js/cryptoflow.svg)](https://badge.fury.io/js/cryptoflow)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## 🌟 Features\n\n- ✨ Zero external dependencies\n- 🔒 Military-grade encryption (AES-256-GCM)\n- 🔑 RSA public-key cryptography\n- 📝 Digital signatures\n- 🤝 Secure key exchange (ECDH/DH)\n- 🔐 Password generation \u0026 key derivation\n- #️⃣ Multiple hashing algorithms\n- 📦 Full TypeScript support\n\n## 📦 Installation\n\n```bash\nnpm install cryptoflow\n```\n\n## 🚀 Quick Start\n\n```typescript\nimport { CryptoFlow } from 'cryptoflow';\n\n// Symmetric Encryption\nconst key = CryptoFlow.generateKey();\nconst encrypted = CryptoFlow.encrypt(\"sensitive data\", key);\nconst decrypted = CryptoFlow.decrypt(encrypted, key);\n\n// Generate Strong Password\nconst password = CryptoFlow.generatePassword(16, {\n    numbers: true,\n    symbols: true,\n    uppercase: true,\n    lowercase: true\n});\n```\n\n## 📚 API Reference\n\n### Symmetric Encryption\n\n```typescript\n// Generate encryption key\nconst key = CryptoFlow.generateKey();\n\n// Encrypt data\nconst encrypted = CryptoFlow.encrypt(\"sensitive data\", key);\n\n// Decrypt data\nconst decrypted = CryptoFlow.decrypt(encrypted, key);\n```\n\n### RSA Encryption\n\n```typescript\n// Generate RSA key pair\nconst keyPair = CryptoFlow.generateRSAKeyPair();\n\n// Encrypt with public key\nconst encrypted = CryptoFlow.rsaEncrypt(\"secret message\", keyPair.publicKey);\n\n// Decrypt with private key\nconst decrypted = CryptoFlow.rsaDecrypt(encrypted, keyPair.privateKey);\n```\n\n### Digital Signatures\n\n```typescript\n// Sign data\nconst signature = CryptoFlow.digitalSign(data, privateKey);\n\n// Verify signature\nconst isValid = CryptoFlow.verifySignature(data, signature, publicKey);\n```\n\n### Key Exchange\n\n```typescript\n// ECDH Key Exchange\nconst alice = CryptoFlow.createECDHKeyExchange();\nconst bob = CryptoFlow.createECDHKeyExchange();\n\n// Compute shared secret\nconst aliceShared = alice.computeSecret(bob.publicKey);\nconst bobShared = bob.computeSecret(alice.publicKey);\n// aliceShared equals bobShared\n```\n\n### Password Management\n\n```typescript\n// Generate secure password\nconst password = CryptoFlow.generatePassword(16, {\n    numbers: true,\n    symbols: true,\n    uppercase: true,\n    lowercase: true\n});\n\n// Derive key from password\nconst derivedKey = await CryptoFlow.deriveKey(\"user-password\");\n```\n\n### Hashing\n\n```typescript\n// Single hash\nconst hash = CryptoFlow.hash(\"data\");\n\n// Multiple hash algorithms\nconst multiHash = CryptoFlow.multiHash(\"data\", [\"sha256\", \"sha512\"]);\n```\n\n## 🔒 Security Features\n\n- Uses cryptographically secure random generation\n- Implements constant-time comparison to prevent timing attacks\n- Follows cryptographic best practices\n- Proper error handling for security-related issues\n\n## 🎯 Use Cases\n\n1. **Secure Data Storage**\n   - Encrypt sensitive data before storing in databases\n   - Protect configuration files\n   - Secure file storage systems\n\n2. **User Authentication**\n   - Password hashing\n   - Token generation\n   - Session management\n\n3. **Secure Communication**\n   - End-to-end encryption\n   - Secure message exchange\n   - API authentication\n\n4. **Digital Signatures**\n   - Document signing\n   - Transaction verification\n   - Software updates\n\n## ⚙️ TypeScript Support\n\nCryptoFlow is written in TypeScript and includes comprehensive type definitions:\n\n```typescript\ninterface PasswordOptions {\n    numbers?: boolean;\n    symbols?: boolean;\n    uppercase?: boolean;\n    lowercase?: boolean;\n}\n\ninterface RSAKeyPair {\n    publicKey: string;\n    privateKey: string;\n}\n\ninterface KeyDerivationResult {\n    key: Buffer;\n    salt: Buffer;\n}\n```\n\n## 🛡️ Best Practices\n\n1. **Key Management**\n   - Securely store encryption keys\n   - Use key derivation for password-based keys\n   - Rotate keys periodically\n\n2. **Error Handling**\n   ```typescript\n   try {\n       const encrypted = CryptoFlow.encrypt(data, key);\n   } catch (error) {\n       if (error instanceof CryptoFlowException) {\n           console.error('Encryption failed:', error.message);\n       }\n   }\n   ```\n\n3. **Secure Configuration**\n   - Use appropriate key sizes\n   - Choose strong algorithms\n   - Implement proper key storage\n\n## 📋 Requirements\n\n- Node.js 14.0.0 or higher\n- TypeScript 4.0.0 or higher (for TypeScript users)\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriday2su%2Fcryptoflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriday2su%2Fcryptoflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriday2su%2Fcryptoflow/lists"}