TGBOX: encrypted cloud storage based on Telegram
================================================
.. epigraph::
| ❕ This repository contains a set of classes and functions used to manage TGBOX.
| Try the `tgbox-cli <https://github.com/NotStatilko/tgbox-cli>`__ if you're interested in working implementation!
.. code-block:: python
import tgbox, tgbox.api.sync
# This two will not work. Get your own at https://my.telegram.org
API_ID, API_HASH = 1234567, '00000000000000000000000000000000'
tc = tgbox.api.TelegramClient(api_id=API_ID, api_hash=API_HASH)
tc.start() # This method will prompt you for Phone, Code & Password
print(phrase := tgbox.keys.Phrase.generate()) # Your secret Box Phrase
basekey = tgbox.keys.make_basekey(phrase) # Will Require 1GB of RAM
box = tgbox.api.make_box(tc, basekey) # Will make Encrypted File Storage
# Will upload selected file to the RemoteBox, cache information
# in LocalBox and return the tgbox.api.abstract.BoxFile object
abbf = box.push(input('File to upload (path): '))
# Retrieving some info from the BoxFile
print('File size:', abbf.size, 'bytes')
print('File name:', abbf.file_name)
downloaded = abbf.download() # Downloading your file from Remote.
print(downloaded) # Will print path to downloaded file object
box.done() # Work is done. Close all connections!
.. epigraph::
| ❔ This code block heavily utilize the magic ``tgbox.api.sync`` module and high-level functions
| from the ``tgbox.api.abstract`` module for showcase. For actual *Async* code, see `Examples <https://tgbox.readthedocs.io/en/latest/examples.html>`__.
Motivation
----------
The Telegram is beautiful app. Not only by mean of features and Client API, but it's also used to be good in cryptography and secure messaging. In the last years, core and client devs of Telegram mostly work for "social-network features", i.e video chats and message reactions which is OK (until stories, wtf?), but there also can be plenty of "crypto-related" things implemented.
Target
------
This *[unofficial]* library targets to be a PoC of **encrypted file storage** inside the Telegram, and should be used as standalone *Python library*.
Abstract
--------
We name *"encrypted cloud storage"* as **Box** and the API to it as ``tgbox``. The *Box* splits into the **RemoteBox** and the **LocalBox**. They define a basic primitives. You can **share** your *Box* and separate *Files* with other people absolutely **secure** - only You and someone you want will have decryption key, even through insecure communication canals (`e2e <https://en.wikipedia.org/wiki/End-to-end_encryption>`__). You can make **unlimited** amount of Boxes, Upload & Download **speed is faster** than in official Telegram clients and maximum filesize is around **2GB** and around **4GB** for Premium users.
Documentation
-------------
See `ReadTheDocs <https://tgbox.readthedocs.io/>`__ for main information and help.
You can also build docs from the source
.. code-block:: console
git clone https://github.com/NonProject/tgbox --branch=indev
cd tgbox && python3 -m pip install .[doc] # Install with doc
cd docs && make html && firefox _build/html/index.html
Third party & thanks to
-----------------------
- `⭐️ <https://github.com/NonProjects/tgbox/stargazers>`__ **Stargazers!**
- `Sphinx_book_theme <https://github.com/executablebooks/sphinx-book-theme>`__ (`BSD 3-Clause <https://github.com/executablebooks/sphinx-book-theme/blob/master/LICENSE>`__)
- `Aiosqlite <https://github.com/omnilib/aiosqlite>`__ (`MIT <https://github.com/omnilib/aiosqlite/blob/main/LICENSE>`__)
- `Telethon <https://github.com/LonamiWebs/Telethon>`__ (`MIT <https://github.com/LonamiWebs/Telethon/blob/master/LICENSE>`__)
- `Ecdsa <https://github.com/tlsfuzzer/python-ecdsa>`__ (`LICENSE <https://github.com/tlsfuzzer/python-ecdsa/blob/master/LICENSE>`__)
- `Filetype <https://github.com/h2non/filetype.py>`__ (`MIT <https://github.com/h2non/filetype.py/blob/master/LICENSE>`__)
- `Cryptg <https://github.com/cher-nov/cryptg>`__ (`LICENSE <https://github.com/cher-nov/cryptg/blob/master/LICENSE.txt>`__)
- `Cryptography <https://github.com/pyca/cryptography>`__ (`LICENSE <https://github.com/pyca/cryptography/blob/main/LICENSE>`__)
Resources
---------
- Official **developer channel**: `@nontgbox <https://telegram.me/nontgbox>`__
- **Example** TGBOX **container**: `@nontgbox_non <https://telegram.me/nontgbox_non>`__
Raw data
{
"_id": null,
"home_page": "https://github.com/NonProjects/tgbox",
"name": "tgbox",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Telegram, Cloud-Storage, Cloud, API, Asyncio, Non-official",
"author": "NonProjects",
"author_email": "thenonproton@pm.me",
"download_url": "https://files.pythonhosted.org/packages/67/b1/a145f8775f4d15ba029bcf0ed6a39614165e90ebecb28aa41cf4732ceddd/tgbox-1.5.1.tar.gz",
"platform": null,
"description": "TGBOX: encrypted cloud storage based on Telegram\n================================================\n.. epigraph::\n\n | \u2755 This repository contains a set of classes and functions used to manage TGBOX.\n | Try the `tgbox-cli <https://github.com/NotStatilko/tgbox-cli>`__ if you're interested in working implementation!\n\n.. code-block:: python\n\n import tgbox, tgbox.api.sync\n\n # This two will not work. Get your own at https://my.telegram.org\n API_ID, API_HASH = 1234567, '00000000000000000000000000000000'\n\n tc = tgbox.api.TelegramClient(api_id=API_ID, api_hash=API_HASH)\n tc.start() # This method will prompt you for Phone, Code & Password\n\n print(phrase := tgbox.keys.Phrase.generate()) # Your secret Box Phrase\n basekey = tgbox.keys.make_basekey(phrase) # Will Require 1GB of RAM\n box = tgbox.api.make_box(tc, basekey) # Will make Encrypted File Storage\n\n # Will upload selected file to the RemoteBox, cache information\n # in LocalBox and return the tgbox.api.abstract.BoxFile object\n abbf = box.push(input('File to upload (path): '))\n\n # Retrieving some info from the BoxFile\n print('File size:', abbf.size, 'bytes')\n print('File name:', abbf.file_name)\n\n downloaded = abbf.download() # Downloading your file from Remote.\n print(downloaded) # Will print path to downloaded file object\n\n box.done() # Work is done. Close all connections!\n\n.. epigraph::\n\n | \u2754 This code block heavily utilize the magic ``tgbox.api.sync`` module and high-level functions\n | from the ``tgbox.api.abstract`` module for showcase. For actual *Async* code, see `Examples <https://tgbox.readthedocs.io/en/latest/examples.html>`__.\n\nMotivation\n----------\n\nThe Telegram is beautiful app. Not only by mean of features and Client API, but it's also used to be good in cryptography and secure messaging. In the last years, core and client devs of Telegram mostly work for \"social-network features\", i.e video chats and message reactions which is OK (until stories, wtf?), but there also can be plenty of \"crypto-related\" things implemented.\n\nTarget\n------\n\nThis *[unofficial]* library targets to be a PoC of **encrypted file storage** inside the Telegram, and should be used as standalone *Python library*.\n\nAbstract\n--------\n\nWe name *\"encrypted cloud storage\"* as **Box** and the API to it as ``tgbox``. The *Box* splits into the **RemoteBox** and the **LocalBox**. They define a basic primitives. You can **share** your *Box* and separate *Files* with other people absolutely **secure** - only You and someone you want will have decryption key, even through insecure communication canals (`e2e <https://en.wikipedia.org/wiki/End-to-end_encryption>`__). You can make **unlimited** amount of Boxes, Upload & Download **speed is faster** than in official Telegram clients and maximum filesize is around **2GB** and around **4GB** for Premium users.\n\nDocumentation\n-------------\n\nSee `ReadTheDocs <https://tgbox.readthedocs.io/>`__ for main information and help.\n\nYou can also build docs from the source\n\n.. code-block:: console\n\n git clone https://github.com/NonProject/tgbox --branch=indev\n cd tgbox && python3 -m pip install .[doc] # Install with doc\n cd docs && make html && firefox _build/html/index.html\n\nThird party & thanks to\n-----------------------\n- `\u2b50\ufe0f <https://github.com/NonProjects/tgbox/stargazers>`__ **Stargazers!**\n- `Sphinx_book_theme <https://github.com/executablebooks/sphinx-book-theme>`__ (`BSD 3-Clause <https://github.com/executablebooks/sphinx-book-theme/blob/master/LICENSE>`__)\n- `Aiosqlite <https://github.com/omnilib/aiosqlite>`__ (`MIT <https://github.com/omnilib/aiosqlite/blob/main/LICENSE>`__)\n- `Telethon <https://github.com/LonamiWebs/Telethon>`__ (`MIT <https://github.com/LonamiWebs/Telethon/blob/master/LICENSE>`__)\n- `Ecdsa <https://github.com/tlsfuzzer/python-ecdsa>`__ (`LICENSE <https://github.com/tlsfuzzer/python-ecdsa/blob/master/LICENSE>`__)\n- `Filetype <https://github.com/h2non/filetype.py>`__ (`MIT <https://github.com/h2non/filetype.py/blob/master/LICENSE>`__)\n- `Cryptg <https://github.com/cher-nov/cryptg>`__ (`LICENSE <https://github.com/cher-nov/cryptg/blob/master/LICENSE.txt>`__)\n- `Cryptography <https://github.com/pyca/cryptography>`__ (`LICENSE <https://github.com/pyca/cryptography/blob/main/LICENSE>`__)\n\nResources\n---------\n- Official **developer channel**: `@nontgbox <https://telegram.me/nontgbox>`__\n- **Example** TGBOX **container**: `@nontgbox_non <https://telegram.me/nontgbox_non>`__\n",
"bugtrack_url": null,
"license": "LGPL-2.1",
"summary": "Encrypted cloud storage Protocol based on a Telegram API",
"version": "1.5.1",
"project_urls": {
"Download": "https://github.com/NonProjects/tgbox/archive/refs/tags/v1.5.1.tar.gz",
"Homepage": "https://github.com/NonProjects/tgbox"
},
"split_keywords": [
"telegram",
" cloud-storage",
" cloud",
" api",
" asyncio",
" non-official"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82173eebb2776ae52e9a068768b214345e186d31e00140a0656db33cd2b20581",
"md5": "9b1ca54261b23eea6152cd43cc0733b7",
"sha256": "f4840d9bfe646da14028e219ba08e5255ba960878b360affa44a9ccdfc855f31"
},
"downloads": -1,
"filename": "tgbox-1.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9b1ca54261b23eea6152cd43cc0733b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 127701,
"upload_time": "2024-08-28T01:48:21",
"upload_time_iso_8601": "2024-08-28T01:48:21.302425Z",
"url": "https://files.pythonhosted.org/packages/82/17/3eebb2776ae52e9a068768b214345e186d31e00140a0656db33cd2b20581/tgbox-1.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "67b1a145f8775f4d15ba029bcf0ed6a39614165e90ebecb28aa41cf4732ceddd",
"md5": "94b446f1898f3c73f0f97f4c98d300a1",
"sha256": "23228645e31dcc41416522d8cc80b58e9fefb3719992c6190662b28f8509bc3b"
},
"downloads": -1,
"filename": "tgbox-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "94b446f1898f3c73f0f97f4c98d300a1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 125248,
"upload_time": "2024-08-28T01:48:23",
"upload_time_iso_8601": "2024-08-28T01:48:23.787456Z",
"url": "https://files.pythonhosted.org/packages/67/b1/a145f8775f4d15ba029bcf0ed6a39614165e90ebecb28aa41cf4732ceddd/tgbox-1.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-28 01:48:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NonProjects",
"github_project": "tgbox",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tgbox"
}