A secure, end-to-end encrypted file and password sharing Telegram bot with automatic cleanup and premium features.
- End-to-end encryption for all content
- Password protection for sensitive transfers
- Automatic expiry (15 minutes, extendable for premium)
- Secure file storage with no logs
- Zero-knowledge architecture
- One-click file uploads - just send any file
- Instant text sharing - type and share
- Direct links - recipients get direct bot access
- QR code generation - scan to access packages instantly
- AirDrop-style sharing - instant nearby device transfer
- Auto-cleanup - files deleted after receipt
- Intuitive interface with inline buttons
- QR code sharing for instant transfers
- Multiple sharing options (link, QR, Telegram share)
- Usage statistics and limits tracking
- Premium tier with increased limits
- Mobile-friendly design
- 50MB max file size
- 5 transfers per day
- Basic encryption
- 15-minute expiry
- 1GB max file size
- 20 transfers per day
- Advanced security features
- (Future) Extend expiry to 24 hours
- Message @BotFather on Telegram
- Send
/newbotand follow instructions - Copy your bot token
- Fork this repository
- Connect to Railway
- Add environment variable:
TELEGRAM_BOT_TOKEN=your_bot_token - Deploy!
# Clone repository
git clone <your-repo-url>
cd SecShare
# Install dependencies
pip install -r requirements.txt
# Dependencies include:
# - python-telegram-bot: Telegram bot API
# - cryptography: Encryption and security
# - qrcode[pil]: QR code generation with custom styling
# - Pillow: Image processing for QR codes
# Set environment variable
export TELEGRAM_BOT_TOKEN=your_bot_token
# Run bot
python main.pySecShare/
โโโ main.py # Telegram bot interface
โโโ SecShare.py # Core bot functionality
โโโ requirements.txt # Python dependencies
โโโ railway.json # Railway deployment config
โโโ README.md # This file
โโโ data/ # User and transfer data (auto-created)
โโโ temp_files/ # Temporary file storage (auto-created)
TELEGRAM_BOT_TOKEN: Your Telegram bot token (required)ADMIN_USER_ID: Your Telegram user ID for admin access (optional)STARS_PROVIDER_TOKEN: Telegram Stars provider token for payments (optional)CONTACT_INFO: Contact information for support (optional, defaults to "Contact admin for support")
To enable Telegram Stars payments for premium features:
-
Get a Stars Provider Token:
- Contact @BotFather and request a Stars provider token
- Or apply through Telegram's payment system
- Set the token as
STARS_PROVIDER_TOKENenvironment variable
-
Configure Prices:
- 1 Day: โญ 50 stars
- 1 Week: โญ 150 stars
- 1 Month: โญ 300 stars
- 3 Months: โญ 500 stars
- 1 Year: โญ 1000 stars
- Prices are configured in the bot code
-
Payment Flow:
- Users click "Upgrade to Premium"
- Choose from 5 subscription options
- Pay with Telegram Stars
- Automatically upgraded to premium
- Beta warning displayed to users
-
Fallback:
- If Stars not configured, shows "I'm Interested" button
- Sends admin notification for manual processing
self.config = {
'free_file_size_limit': 50 * 1024 * 1024, # 50MB
'premium_file_size_limit': 1024 * 1024 * 1024, # 1GB
'free_transfers_per_hour': 5,
'premium_transfers_per_hour': 20,
'transfer_expiry_minutes': 15, # 15 minutes (default)
# Future: allow premium users to extend to 24 hours
'temp_dir': 'temp_files',
'data_dir': 'data'
}- Send a file - Upload any file to the bot
- Send text - Type your message and send
- Get link & QR code - Bot provides secure link and QR code
- Share options - Choose from multiple sharing methods:
- ๐ Direct link sharing
- ๐ฑ QR code scanning
- ๐ค Telegram built-in sharing
- ๐ฑ AirDrop-style nearby sharing
- Click link or scan QR - Opens bot with transfer
- Enter password (if required)
- Receive content - File or text delivered
- Confirm receipt - Auto-deletes content (expires in 15 minutes)
/start- Welcome message and main menu/help- Show help information/stats- View your usage statistics/premium- Upgrade to premium plan/airdrop- AirDrop-style sharing interface
- Fernet symmetric encryption for text content
- PBKDF2 password hashing with salt
- Secure key generation using cryptography library
- Short-lived transfers (15 minutes by default, extendable for premium in the future)
- No persistent logs of file content
- Automatic cleanup of expired transfers
- Secure file deletion after receipt
- User data isolation
- Anonymous transfers - no sender tracking
- Temporary storage - files not permanently stored
- Zero-knowledge - bot can't access content
- Connect your GitHub repository to Railway
- Add environment variable:
TELEGRAM_BOT_TOKEN - Deploy automatically on push
- Heroku: Add
Procfilewithworker: python main.py - DigitalOcean: Use App Platform
- VPS: Run with
python main.py
- QR code generation with Telegram-style design
- AirDrop-style sharing for instant nearby transfers
- Multiple sharing options (link, QR, Telegram share)
- Premium subscription system with payment integration
- Advanced encryption with RSA key pairs
- File compression for larger transfers
- Transfer scheduling for delayed delivery
- Group sharing with multiple recipients
- Transfer analytics and usage reports
- API endpoints for external integrations
- Web interface for management
- Database integration (PostgreSQL/MongoDB)
- Redis caching for better performance
- CDN integration for file storage
- Rate limiting and DDoS protection
- Monitoring and alerting system
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check this README
- Issues: Create a GitHub issue
- Telegram: Contact @your_support_username
This bot is designed for secure file sharing but should not be used for illegal content. Users are responsible for their own content and compliance with local laws.
Made with โค๏ธ for secure communication