{"id":25138709,"url":"https://github.com/truethari/timecipher","last_synced_at":"2025-04-24T03:08:36.283Z","repository":{"id":268280091,"uuid":"903685098","full_name":"truethari/TimeCipher","owner":"truethari","description":"TimeCipher is a blockchain-based time-locked messaging system that securely encrypts messages with a timestamp, ensuring they can only be decrypted after the specified time. This innovative solution combines privacy and delayed access, perfect for secure future communication.","archived":false,"fork":false,"pushed_at":"2024-12-16T14:18:25.000Z","size":136,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T03:08:30.527Z","etag":null,"topics":["blockchain","encryption","messaging","privacy","secure-communication","time-lock","timecipher"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/timecipher","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/truethari.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-12-15T09:31:55.000Z","updated_at":"2024-12-17T10:12:17.000Z","dependencies_parsed_at":"2024-12-15T19:23:43.863Z","dependency_job_id":"88d3a59b-cead-4fa1-95eb-b92183178cda","html_url":"https://github.com/truethari/TimeCipher","commit_stats":null,"previous_names":["truethari/timecipher"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truethari%2FTimeCipher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truethari%2FTimeCipher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truethari%2FTimeCipher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truethari%2FTimeCipher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truethari","download_url":"https://codeload.github.com/truethari/TimeCipher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552074,"owners_count":21449164,"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":["blockchain","encryption","messaging","privacy","secure-communication","time-lock","timecipher"],"created_at":"2025-02-08T17:18:29.148Z","updated_at":"2025-04-24T03:08:36.263Z","avatar_url":"https://github.com/truethari.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimeCipher\n\nTimeCipher is a blockchain-based time-locked messaging system that securely encrypts messages with a timestamp, ensuring they can only be decrypted after the specified time. This innovative solution combines privacy and delayed access, perfect for secure future communication.\n\n### Table of Contents\n\n- [Installation](#installation)\n- [Features](#features)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n- [Types](#types)\n- [License](#license)\n\n## Installation\n\nInstall the library using npm or yarn or bun:\n\n```bash\nnpm install timecipher\n```\n\nor\n\n```bash\nyarn install timecipher\n```\n\nor\n\n```bash\nbun install timecipher\n```\n\n## Features\n\n- Encrypt and decrypt messages using the contract's logic.\n- Check the active status of an encrypted message.\n- Get the activation timestamp of an encrypted message.\n- Retrieve timestamps from the smart contract.\n\n## Usage\n\nFirst, import the necessary methods from the library:\n\n```javascript\nimport { getTimestamp, encryptMessage, decryptMessage, isActive, whenActive } from \"timecipher\";\n```\n\nExample: Encrypting a message\n\n```javascript\nconst message = \"Hello, World!\";\nconst timestamp = Math.floor(Date.now() / 1000);\n\nconst encryptedMessage = await encryptMessage(message, timestamp);\nconsole.log(\"Encrypted Message:\", encryptedMessage);\n```\n\nExample: Decrypting a message\n\n```javascript\nconst decryptedMessage = await decryptMessage(encryptedMessage);\nconsole.log(\"Decrypted Message:\", decryptedMessage);\n```\n\nExample: Checking if a message is active\n\n```javascript\nconst active = await isActive(encryptedMessage);\nconsole.log(\"Is Active:\", active);\n```\n\nExample: Getting the activation timestamp\n\n```javascript\nconst activationTimestamp = await whenActive(encryptedMessage);\nconsole.log(\"Activation Timestamp:\", activationTimestamp);\n```\n\nExample: Retrieving the current timestamp\n\n```javascript\nconst timestamp = await getTimestamp();\nconsole.log(\"Current Timestamp:\", timestamp);\n```\n\n## API Documentation\n\n`decryptMessage(encryptedMessage: string, _config?: IExtendedConfig): Promise\u003cstring\u003e`\n\nDecrypts an encrypted message using the smart contract.\n\n**Parameters:**\n\n- encryptedMessage: The encrypted message to decrypt.\n- `_config` (optional): An object to override default configuration.\n\n**Returns:**\n\n- A promise that resolves to the decrypted message as a string.\n\n---\n\n`isActive(encryptedMsg: string, _config?: IExtendedConfig): Promise\u003cboolean\u003e`\n\nChecks if a message is active in the smart contract.\n\n**Parameters:**\n\n- encryptedMsg: The encrypted message to check.\n- `_config` (optional): An object to override default configuration.\n\n**Returns:**\n\n- A promise that resolves to a boolean indicating if the message is active.\n\n---\n\n`whenActive(encryptedMsg: string, _config?: IExtendedConfig): Promise\u003cnumber\u003e`\n\nGets the activation timestamp of an encrypted message.\n\n**Parameters:**\n\n- encryptedMsg: The encrypted message to check.\n- `_config` (optional): An object to override default configuration.\n\n**Returns:**\n\n- A promise that resolves to the activation timestamp as a number.\n\n---\n\n`getTimestamp(_config?: IExtendedConfig): Promise\u003cnumber\u003e`\n\nRetrieves the current timestamp from the smart contract.\n\n**Parameters:**\n\n- `_config` (optional): An object to override default configuration.\n\n**Returns:**\n\n- A promise that resolves to the current timestamp as a number.\n\n## Types\n\n```typescript\ninterface IExtendedConfig {\n  provider?: ethers.JsonRpcProvider;\n  contractAddress?: string;\n  rpcUrl?: string;\n  abi?: any;\n}\n```\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%2Ftruethari%2Ftimecipher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruethari%2Ftimecipher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruethari%2Ftimecipher/lists"}