A Mutable Log

A blog by Devendra Tewari


Project maintained by tewarid Hosted on GitHub Pages — Theme by mattgraham

Secure file transmission using asymmetric cryptography

The secure file transmission mechanism, depicted in the diagram below, has the following properties

graph LR
    Program-->data[Encrypted Data]
    data-->Service
    subgraph Alice
        priva[Alice's Private Key]-->Program
        pubb[Server's Public Key]-->Program
        file1[File]-->Program
    end
    subgraph Server
        privb[Server's Private Key]-->Service
        puba[Alice's Public Key]-->Service
        Service-->file2[File]
    end

Here’s how the mechanism works

  1. Program calculates a secure hash of file data
  2. Program encrypts file data using a randomly generated secret key
  3. Program encrypts hash and secret key using Alice’s private key, and Server’s public key
  4. Program transmits all encrypted data to Server
  5. Server decrypts hash and secret key using its private key and Alice’s public key
  6. Server decrypts file data using secret key
  7. Server calculates hash of file data and compares it with hash sent by Program