Contract Sign

Python program to read, encrypt and sign a contract using RSA

This application walks through the contractual process of Titan (my cat) selling Charlie (my dog) 1 dog bowl for 1 BTC.

1.  Loads the Contract--a text file right now.

2.  Charlie (the Buyer) and Titan (the Seller) each generate RSA private public key pairs for separate encryption and signature keys.

3. Charlie sends encryption public key to Titan.Titan receives the key, saves and loads it.

4.  App verifies that loaded key is the same as Charlie's public key.

5.  Titan encrypts the contract using Charlie's public key, sends it to Charlie along with his public encryption key.  

6.  Charlie receives from Titan. Uses his private encryption key to decrypt the contract.

7.  App verifies it is the same as the original contract.

8.  Charlie hashes the contract (SHA256) and uses his private signature key to sign the contract.  The he uses Titan's encryption public key to encrypt the contract.

9.  Charlie sends the encrypted contract, signature, and his signature public key to Titan.

10. Titan decrypts the contract and verifies it is the same as the original.

11. Titan verifies Charlie's signature using Charlie's signature public key.

Binding Contract.  Titan can now ship the goods.  But how will he get paid?  Maybe see the LNContract App for that!
Built with:

Python/RSA Encryption

github
About the project

Python program to read, encrypt and sign a contract using RSA

This application walks through the contractual process of Titan (my cat) selling Charlie (my dog) 1 dog bowl for 1 BTC.

1. Loads the Contract--a text file right now.

2. Charlie (the Buyer) and Titan (the Seller) each generate RSA private public key pairs for separate encryption and signature keys.

3. Charlie sends encryption public key to Titan.Titan receives the key, saves and loads it.

4. App verifies that loaded key is the same as Charlie's public key.

5. Titan encrypts the contract using Charlie's public key, sends it to Charlie along with his public encryption key.

6. Charlie receives from Titan. Uses his private encryption key to decrypt the contract.

7. App verifies it is the same as the original contract.

8. Charlie hashes the contract (SHA256) and uses his private signature key to sign the contract. The he uses Titan's encryption public key to encrypt the contract.

9. Charlie sends the encrypted contract, signature, and his signature public key to Titan.

10. Titan decrypts the contract and verifies it is the same as the original.

11. Titan verifies Charlie's signature using Charlie's signature public key.

Binding Contract. Titan can now ship the goods. But how will he get paid? Maybe see the LNContract App for that!