{"id":14977717,"url":"https://github.com/kokseen1/sanzan","last_synced_at":"2025-10-28T05:31:13.606Z","repository":{"id":41190562,"uuid":"485719448","full_name":"kokseen1/Sanzan","owner":"kokseen1","description":"Video encryption while maintaining playability.","archived":false,"fork":false,"pushed_at":"2023-01-13T07:47:55.000Z","size":73018,"stargazers_count":9,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T12:11:12.412Z","etag":null,"topics":["audio","audio-encryption","audio-processing","cv2","data-science","decrypt","decryption","deobfuscation","encryption","ffmpeg","numpy","obfuscation","opencv","pydub","python","video","video-encryption","video-processing"],"latest_commit_sha":null,"homepage":"","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/kokseen1.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}},"created_at":"2022-04-26T09:30:59.000Z","updated_at":"2025-01-16T13:01:33.000Z","dependencies_parsed_at":"2023-02-09T15:16:39.139Z","dependency_job_id":null,"html_url":"https://github.com/kokseen1/Sanzan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokseen1%2FSanzan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokseen1%2FSanzan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokseen1%2FSanzan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokseen1%2FSanzan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kokseen1","download_url":"https://codeload.github.com/kokseen1/Sanzan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238603665,"owners_count":19499488,"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":["audio","audio-encryption","audio-processing","cv2","data-science","decrypt","decryption","deobfuscation","encryption","ffmpeg","numpy","obfuscation","opencv","pydub","python","video","video-encryption","video-processing"],"created_at":"2024-09-24T13:56:11.657Z","updated_at":"2025-10-28T05:31:03.591Z","avatar_url":"https://github.com/kokseen1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sanzan\n\n[![PyPI Release](https://github.com/kokseen1/Sanzan/actions/workflows/release.yml/badge.svg)](https://github.com/kokseen1/Sanzan/actions/workflows/release.yml)\n[![PyPI Version](https://img.shields.io/pypi/v/sanzan.svg)](https://pypi.python.org/pypi/sanzan/)\n\nSanzan is a simple encryption library to encrypt and decrypt videos while maintaining playability.\n\nIt uses NumPy and OpenCV to perform video frame manipulation, while using FFmpeg and Pydub for audio manipulation. Sanzan can be used either from the command line or in a Python program.\n\n### Encrypted Video\n\n![Encrypted](https://raw.githubusercontent.com/kokseen1/Sanzan/main/img/enc.gif?raw=True)\n\n### Decrypted Video:\n\n![Decrypted](https://raw.githubusercontent.com/kokseen1/Sanzan/main/img/dec.gif?raw=True)\n\n## Installation\n\n### Prerequisite\n\n[FFmpeg](https://www.ffmpeg.org/download.html) must be installed and in `PATH`.\n\n```shell\npip install sanzan\n```\n\n## Usage\n\n### Encryption\n\n```shell\nsz original.mp4 -k \u003ckey\u003e -e -o encrypted.mp4 \n```\n\n#### On a stream\n\n```shell\nsz https://youtu.be/dQw4w9WgXcQ -k \u003ckey\u003e -e -o encrypted.mp4 \n```\n\n### Decryption\n\n```shell\nsz encrypted.mp4 -k \u003ckey\u003e -d -o decrypted.mp4 \n```\n\n#### With preview\n\n```shell\nsz encrypted.mp4 -k \u003ckey\u003e -d -o decrypted.mp4 -p\n```\n\n- Frames will be displayed as quickly as they are generated.\n- Audio will only start playing after the whole stream has been processed.\n\n### More Usage\n\nOmit the `-k` argument to encrypt using randomly generated keyfiles.\n\nUse the `-m` argument to specify mode: `audio`, `video` or `full` (default).\n\nUse the `-q` flag for quiet mode.\n\n#### Audio options\n\nUse the `-a` argument to specify output audio format: `mp3`, `wav` (default), `flac`, etc.\n\nUse the `-l` flag to use light encryption/decryption.\n\nUse the `-dn` flag to apply denoising to the output audio.\n\nUse the `-pp` flag to disable audio padding.\n\n#### Video options\n\nUse the `-s` argument to specify scramble method: `rows` (default), `cols`, `full`.\n\nUse the `-f` flag to generate a different scramble order every frame.\n\n### Python Usage\n\nAlternatively, Sanzan provides a Python interface to programmatically access its functionality.\n\n#### Encryption\n\n```python\nfrom sanzan import Sanzan\n\nif __name__ == \"__main__\":\n    s = Sanzan(\"original.mp4\")\n    s.set_password(\"1234\")\n    s.encrypt(\"encrypted.mp4\")\n```\n\n#### Decryption\n\n```python\nfrom sanzan import Sanzan\n\nif __name__ == \"__main__\":\n    s = Sanzan(\"encrypted.mp4\")\n    s.set_password(\"1234\")\n    s.decrypt(\"decrypted.mp4\", preview=True, denoise=True)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokseen1%2Fsanzan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokseen1%2Fsanzan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokseen1%2Fsanzan/lists"}