How chandhanredd/secure-file-storage-using-hybrid-cryptography works
What this project is (type + purpose)
From the README + file tree, this is a Python application that provides secure cloud file storage using hybrid cryptography.
“Hybrid cryptography” in this context almost certainly means:
• Symmetric encryption (fast; e.g., AES) for the file contents, and
• Asymmetric encryption (e.g., RSA) for encrypting the symmetric key (and possibly IV/metadata) so only an authorized user can decrypt.
The presence of:
• client_secrets.json + token_drive_v3.pickle strongly indicates Google Drive API OAuth integration.
• Files like Encrypt.py, Decrypt.py, IVsKeys.py suggest a clear separation of encryption/decryption and key/IV handling.
• app.py, Main.py, demo.py, test.py suggest there may be multiple entrypoints: a web app (likely Flask) and/or CLI demo scripts.
• A local client app that does crypto locally
• A cloud storage backend (Google Drive) that stores only ciphertext + encrypted keys/metadata
• An auth layer (Google OAuth) enabling Drive access
Core crypto layer
• Encrypt.py — file encryption pipeline (symmetric encryption + packaging)
• Decrypt.py — inverse pipeline
• IVsKeys.py — generation/loading/storing IVs + keys; possibly RSA keypair handling
Application orchestration / UX
• Main.py — likely primary controller for the flow (select file → encrypt → upload; download → decrypt)
• app.py — likely a web interface/API endpoint layer (common filename for Flask apps)
• demo.py, test.py — demonstration/testing entrypoints
Cloud integration
• googlee.py — likely wraps Google Drive operations (upload, download, list, auth)
• client_secrets.json — OAuth client credentials (Google API)
• token_drive_v3.pickle — cached OAuth tokens for Drive API access
Supporting utilities
• dataProcessing.py — file chunking, encoding/decoding, metadata formatting, etc.
• Threads.py — concurrency for encrypting/uploading/downloading (e.g., chunk uploads)
Data artifacts (what moves through the system)
• Original.txt → plaintext input example
• Output.txt → ciphertext output example (or decrypted output depending on flow)
Local Python Application Container
• “UI Layer” (CLI via Main.py and/or Web via app.py)
• “Crypto Engine” (Encrypt.py, Decrypt.py, IVsKeys.py)
• “Drive Client” (googlee.py + Google API SDK)
• “Processing + Concurrency” (dataProcessing.py, Threads.py)
• “Local Credential Store” (token_drive_v3.pickle, client_secrets.json)
Google Cloud Container
• Google Drive Storage (encrypted file objects)
• “Drive Metadata” (filenames, file IDs, any stored key blob)
Important detail to be explicit about:
• Encryption happens locally; Google Drive only sees ciphertext.
• OAuth token enables Drive access but does not grant plaintext access without keys.
• app.py / Main.py
Role: request handler / workflow orchestration
Calls into: encryption/decryption, Drive upload/download
• Encrypt.py
Role: generate session key/IV, encrypt file data
Depends on: IVsKeys.py, dataProcessing.py (likely)
• Decrypt.py
Role: retrieve encrypted key blob, decrypt session key, decrypt file data
Depends on: IVsKeys.py, dataProcessing.py
• IVsKeys.py
Role: key generation + storage format (symmetric key, IV, RSA keys)
Outputs: “Encrypted session key blob” and/or key files in a local store
• googlee.py
Role: Google Drive operations (auth, upload, download, list)
Inputs/Outputs: file bytes + metadata, file IDs
• Threads.py
Role: parallelize heavy operations (chunk encryption / chunk upload)
• dataProcessing.py
Role: chunking, buffering, file IO, base64/serialization, packaging metadata (e.g., [ciphertext, encrypted_key, iv])
• Orchestrator → Encrypt/Decrypt
• Encrypt/Decrypt ↔ IVsKeys
• Encrypt/Decrypt ↔ dataProcessing
• Orchestrator → googlee
• googlee ↔ Google Drive API
Encrypt.py
• generates symmetric key (K) and IV
• encrypts file → ciphertext C
• encrypts K (and maybe IV) with asymmetric public key → encKey
googlee.py uploads
• ciphertext C (as the stored file)
• encKey + IV + metadata (either as a separate file or embedded metadata)
• “Encrypted File Blob (C)”
• “Encrypted Key Blob (encKey + IV + metadata)”
Decrypt.py
• decrypts encKey with private key → K
• decrypts ciphertext C with K and IV → plaintext
Architectural patterns to highlight (because they’re implied by structure)
• Local cryptographic boundary: all encryption/decryption is local; cloud is untrusted storage.
• Hybrid encryption pattern: file encrypted with symmetric key; symmetric key protected by asymmetric crypto.
• Adapter/Client wrapper pattern: googlee.py is an adapter over Google Drive SDK.
• Pipeline + utilities: dataProcessing.py and Threads.py imply “process in chunks” and “parallelize”.
If Threads.py is used for chunking and multi-part uploads, call that out as:
• “Chunk Encrypt → Chunk Upload” parallel pipeline.
Participants:
• User
• Main/app
• Encrypt/Decrypt
• IVsKeys
• googlee (Drive client)
• Google OAuth
• Google Drive
Messages should include payload labels: K, IV, C, encKey.