{"id":15866367,"url":"https://github.com/squidmin/python-cryptography-labs","last_synced_at":"2025-04-01T21:20:02.662Z","repository":{"id":235978074,"uuid":"791654966","full_name":"squidmin/python-cryptography-labs","owner":"squidmin","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-25T05:49:57.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T13:54:04.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squidmin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-25T05:49:11.000Z","updated_at":"2024-04-25T05:50:00.000Z","dependencies_parsed_at":"2024-04-25T06:50:05.781Z","dependency_job_id":null,"html_url":"https://github.com/squidmin/python-cryptography-labs","commit_stats":null,"previous_names":["squidmin/python-cryptography-labs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidmin%2Fpython-cryptography-labs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidmin%2Fpython-cryptography-labs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidmin%2Fpython-cryptography-labs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squidmin%2Fpython-cryptography-labs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squidmin","download_url":"https://codeload.github.com/squidmin/python-cryptography-labs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709906,"owners_count":20821298,"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-10-05T23:20:29.677Z","updated_at":"2025-04-01T21:20:02.644Z","avatar_url":"https://github.com/squidmin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-cryptography-labs\n\nThis project is a simple backend service developed using FastAPI that provides APIs for encrypting and decrypting data using AES encryption.\nIt is intended as a straightforward example to demonstrate encryption and decryption in Python with the PyCryptodome library.\n\n## Features\n\n- **Encrypt API**: Allows users to encrypt plaintext and receive ciphertext along with the key and IV needed for decryption.\n- **Decrypt API**: Allows users to decrypt ciphertext using the provided key and IV.\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\nEnsure you have Python 3.7+ installed on your machine. You can download Python from [here](https://www.python.org/downloads/).\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/squidmin/python-cryptography-labs.git\n   cd python-cryptography-labs\n   ```\n\n2. **Create and activate a virtual environment**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n3. **Install the required dependencies**\n   ```bash\n   pip3 install -r requirements.txt\n   ```\n\n### Running the application\n\n1. **Start the server**\n   ```bash\n   uvicorn main:app --reload\n   ```\n   This command will start the server on `http://127.0.0.1:8000`. The `--reload` flag enables auto-reload so the server will restart after code changes.\n\n### Using the API\n\nYou can interact with the API using the automatically generated Swagger UI:\n\n- **Open your web browser and navigate to** `http://127.0.0.1:8000/docs`\n- You can use the interactive API documentation to send requests to encrypt and decrypt data.\n\n#### API Endpoints\n\n- **POST `/encrypt/`**\n  - **Description**: Encrypts provided plaintext.\n  - **Request Body**: `{\"plaintext\": \"your text here\"}`\n  - **Response**: `{\"iv\": \"iv\", \"ciphertext\": \"ciphertext\", \"key\": \"key\"}`\n\n- **POST `/decrypt/`**\n  - **Description**: Decrypts provided ciphertext.\n  - **Request Body**: `{\"ciphertext\": \"your encrypted text here\", \"iv\": \"iv from encryption\", \"key\": \"key from encryption\"}`\n  - **Response**: `{\"plaintext\": \"original text\"}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquidmin%2Fpython-cryptography-labs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquidmin%2Fpython-cryptography-labs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquidmin%2Fpython-cryptography-labs/lists"}