Skip to main content

Encrypted cloud storage Protocol based on a Telegram API

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

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). 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 for main information and help.

You can also build docs 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.6.1.tar.gz (128.2 kB view details)

Uploaded Source

Built Distribution

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

tgbox-1.6.1-py3-none-any.whl (130.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tgbox-1.6.1.tar.gz
  • Upload date:
  • Size: 128.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for tgbox-1.6.1.tar.gz
Algorithm Hash digest
SHA256 e82d51949be5af0be434d5598725f92f1b0ec4688d70010014bcbd4de889c6c1
MD5 6a0808a66b982a4021e5520735ea3b6b
BLAKE2b-256 05876b864261d45b2cc412cfdbea0928a55023ee10da80ca73fbd15e4940ecf9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tgbox-1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 130.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for tgbox-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aff044cbfdbe81c2510e674dfcdf00d3c0f03c33ea3d7ea30822e7c0781ac701
MD5 9a299e6da0bf543690728fec3a11ee44
BLAKE2b-256 ad73d0f8ee65e4ef7fdb04213c7bbe0f4da6d04dd9ada399672ff0e1062c5be8

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