tgbox


Nametgbox JSON
Version 1.7 PyPI version JSON
download
home_pagehttps://github.com/NonProjects/tgbox
SummaryEncrypted cloud storage Protocol based on a Telegram API
upload_time2025-11-03 22:34:04
maintainerNone
docs_urlNone
authorNonProjects
requires_pythonNone
licenseLGPL-2.1
keywords telegram cloud-storage cloud api asyncio non-official
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            TGBOX: encrypted cloud storage based on `Telegram <https://telegram.org>`__
===========================================================================
.. 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
----------

Although **Telegram** started as security-oriented Messenger, in recent years developers shifted its focus from privacy enhancements to social-network features & cryptocurrency integration. You may like or dislike that, but fact is obvious — Telegram can expand on its privacy-focused roots and add some more cool things — like *Encrypted Cloud Storage*. While core developers are busy with their "`gifts <https://telegram.org/blog/wear-gifts-blockchain-and-more>`__", we may make something on our own by utilizing `Telegram Client API <https://core.telegram.org>`__, and here is my vision on it.

Target
------

This **unofficial, and not affiliated with Telegram** library targets to be a Proof of *Concept* of the *Encrypted Cloud Storage* inside the Telegram Messenger. You **can not** use it directly inside your Telegram App (like Desktop or Android client). It's a standalone Python library for developers and alike.

Abstract
--------

In the scope of this project we name *"encrypted cloud storage"* as **Box** and the API to it as ``tgbox``. The *Box* consists of two parts: the **RemoteBox** (place where we store your *encrypted files*) and the **LocalBox** (place where we store *cache information*). They define a basic primitives. You can **share** your *Box* and separate *Files* with other users absolutely **secure** (even through insecure communication canals — `e2e <https://en.wikipedia.org/wiki/End-to-end_encryption>`__) — only You and *Requester* will have decryption key. You can create an **unlimited** amount of *Box* objects, Upload & Download speed is **faster** than in official Telegram clients and maximum file size is around **2GB** for Regular users and around **4GB** for Premium ones.

Documentation
-------------

See `ReadTheDocs <https://tgbox.readthedocs.io/>`__ for main information and help.

You can also build Documentation 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>`__)
- `Uvloop <https://github.com/MagicStack/uvloop>`__ (`MIT <https://github.com/MagicStack/uvloop/blob/master/LICENSE-MIT>`__)

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/4d/ce/ec1f6e679c00ee1ba4421146429e4b1a6c7451bcf20a27b483d4b58a2025/tgbox-1.7.tar.gz",
    "platform": null,
    "description": "TGBOX: encrypted cloud storage based on `Telegram <https://telegram.org>`__\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\nAlthough **Telegram** started as security-oriented Messenger, in recent years developers shifted its focus from privacy enhancements to social-network features & cryptocurrency integration. You may like or dislike that, but fact is obvious \u2014 Telegram can expand on its privacy-focused roots and add some more cool things \u2014 like *Encrypted Cloud Storage*. While core developers are busy with their \"`gifts <https://telegram.org/blog/wear-gifts-blockchain-and-more>`__\", we may make something on our own by utilizing `Telegram Client API <https://core.telegram.org>`__, and here is my vision on it.\n\nTarget\n------\n\nThis **unofficial, and not affiliated with Telegram** library targets to be a Proof of *Concept* of the *Encrypted Cloud Storage* inside the Telegram Messenger. You **can not** use it directly inside your Telegram App (like Desktop or Android client). It's a standalone Python library for developers and alike.\n\nAbstract\n--------\n\nIn the scope of this project we name *\"encrypted cloud storage\"* as **Box** and the API to it as ``tgbox``. The *Box* consists of two parts: the **RemoteBox** (place where we store your *encrypted files*) and the **LocalBox** (place where we store *cache information*). They define a basic primitives. You can **share** your *Box* and separate *Files* with other users absolutely **secure** (even through insecure communication canals \u2014 `e2e <https://en.wikipedia.org/wiki/End-to-end_encryption>`__) \u2014 only You and *Requester* will have decryption key. You can create an **unlimited** amount of *Box* objects, Upload & Download speed is **faster** than in official Telegram clients and maximum file size is around **2GB** for Regular users and around **4GB** for Premium ones.\n\nDocumentation\n-------------\n\nSee `ReadTheDocs <https://tgbox.readthedocs.io/>`__ for main information and help.\n\nYou can also build Documentation 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- `Uvloop <https://github.com/MagicStack/uvloop>`__ (`MIT <https://github.com/MagicStack/uvloop/blob/master/LICENSE-MIT>`__)\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.7",
    "project_urls": {
        "Download": "https://github.com/NonProjects/tgbox/archive/refs/tags/v1.7.tar.gz",
        "Homepage": "https://github.com/NonProjects/tgbox"
    },
    "split_keywords": [
        "telegram",
        " cloud-storage",
        " cloud",
        " api",
        " asyncio",
        " non-official"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "03d5c6bd5d26c813b92d5f47146e0f5f4e83b6102834844ccb6691eb901b382d",
                "md5": "c8400d6760b770d279a912603f04248c",
                "sha256": "44829c44b11396ff787fe3dea91ef35131931ec9a0ecada80da5623c52bc4d92"
            },
            "downloads": -1,
            "filename": "tgbox-1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c8400d6760b770d279a912603f04248c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 266260,
            "upload_time": "2025-11-03T22:34:02",
            "upload_time_iso_8601": "2025-11-03T22:34:02.287857Z",
            "url": "https://files.pythonhosted.org/packages/03/d5/c6bd5d26c813b92d5f47146e0f5f4e83b6102834844ccb6691eb901b382d/tgbox-1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4dceec1f6e679c00ee1ba4421146429e4b1a6c7451bcf20a27b483d4b58a2025",
                "md5": "034dc4fc970a97829d7293e43d365d4b",
                "sha256": "ef28817ce5771b519b17b704faf2946f295261690bb545ecda04e87731b44dfb"
            },
            "downloads": -1,
            "filename": "tgbox-1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "034dc4fc970a97829d7293e43d365d4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 264874,
            "upload_time": "2025-11-03T22:34:04",
            "upload_time_iso_8601": "2025-11-03T22:34:04.495273Z",
            "url": "https://files.pythonhosted.org/packages/4d/ce/ec1f6e679c00ee1ba4421146429e4b1a6c7451bcf20a27b483d4b58a2025/tgbox-1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-03 22:34:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NonProjects",
    "github_project": "tgbox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tgbox"
}
        
Elapsed time: 3.20142s