A file, cut into chunks, locked and sent
On the deviceIn Telegram
A schematic of the method. The file and its six chunks are made up for the drawing.
For playback the chunks are streamed back and decrypted on the fly.
- Outline with two lines: plain data
- Padlock: encrypted
- Three small squares: a chunk's own IV, different on every chunk
The problem and the idea
A Flutter app that turns Telegram into encrypted cloud storage.
What I built
- AES-256-CTR encryption on the device, with its own IV for every 48 MB chunk
- Encrypted file index stored in a pinned Telegram message
- Streaming playback that decrypts on the fly
- PIN-based unlock
The result
- AES-256On-device encryption
- 48 MBChunks, each with its own IV
How many chunks a file becomes
700 MB
700 MB → 15 chunks
14 full chunks of 48 MB and a last one of 28 MB.
15 chunks, so 15 IVs: one for each chunk.
A calculation, not a measurement from the app: the file size divided by the 48 MB chunk size, rounded up, taking the last chunk to hold whatever is left over. The sizes on the slider are examples.
Stack
- Flutter
- Dart
- Telegram Bot API
- AES-256-CTR