Skip to main content

Encrypted cloud storage Protocol based on a Telegram API

Reason this release was yanked:

Oops. contains linux ffmpeg! No good. Use 1.8.0.1

Project description

❕ This repository contains a set of classes and functions used to manage TGBOX.
Try the tgbox-cli if you’re interested in working implementation!
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!
❔ 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.

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”, we may make something on our own by utilizing Telegram Client API, 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) — 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 for main information and help.

You can also build Documentation from the source

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

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgbox-1.8.0.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgbox-1.8.0-py3-none-any.whl (3.4 MB view details)

Uploaded Python 3

File details

Details for the file tgbox-1.8.0.tar.gz.

File metadata

  • Download URL: tgbox-1.8.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tgbox-1.8.0.tar.gz
Algorithm Hash digest
SHA256 e61feefd0d29d00d752411025590f9292d43a92f02a820f382300eb0e041ad87
MD5 eb38e147078bed0f12809857ad00a4d4
BLAKE2b-256 48a1e108e6ca105e8712c3064b7041bceaaf141653d4513c9b9489889911231b

See more details on using hashes here.

File details

Details for the file tgbox-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: tgbox-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tgbox-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4cb2eeed0fea60bc6a4018c7e9e7430d89f9782566b2c12daa091916b303020
MD5 ca966c6f852b081f9b606d71c727c40f
BLAKE2b-256 c90cd861113a0c8c853e31721cf90179b81dc71f418ded81cef87520160b576a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page