# Trusted Third Party Application in Durable Medium e-Service
## 3 The Proposed TTP Application
### The Main Algorithm of the Proposed e-Service  
The proposed e-service concept is presented in Figure 2, in the form of an activity diagram from a unified modeling language (UML). The diagram presents the electronic documents flow and processes such as encrypting and signing documents, storing hashes of documents in the blockchain infrastructure, decrypting and sharing documents between parties, etc. Within the above-mentioned concept, three business actors are distinguished, two of them are connected by a business relationship, and the third one (TTP) is a neutral arbiter monitoring the entire process and offering several functionalities, ensuring the security and confidentiality of the sensitive documents transmitting process as a part of the durable medium service [35]. It is assumed that one of the parties is dominant (here, it is the ISP) and only the ISP is entitled to start the new document processing flow. The second party is represented by ISP customers. Moreover, one ISP can have thousands of clients. The diagram in Figure 2 presents the exemplary process of changing the price list by the ISP. Let us assume further that each customer can accept or reject the new price list (note that the consequences of accepting or rejecting the price list are not considered in this work). The entire process begins on the ISP side by sending a document (here: new price list) and a list of customer identifiers to the TTP, who should accept or reject this document. This transmission of data can be realized using a previously established secure communication channel. In the next step, TTP signs the document (using an electronic signature) and uses AES to generate a 256-bit symmetric key. This key is used for the encryption of the  
Figure 1: The main idea of the proposed e-service on a high level of abstraction. document. Let us underline that the generation of the AES key is performed in a hardware security module (HSM). Due to the limitations of blockchain technology (the size of data stored in one block), only the hash of the document and the identifier of the entity that sent the document (here: ISP) are saved in the blockchain. The fully encrypted document is stored on an external IPFS. It is worth noting that both HSM and IPFS belong to the TTP infrastructure. At the next step, a 256-bit hash of the document is generated by the IPFS (it is assumed that the SHA-256 algorithm is used). The TTP stores both the document and hash in the IPFS network, and creates the link to the document. This link is used further to obtain access to the encrypted document. Moreover, the hash of the document is added to the blockchain as a new transaction. Finally, the generated AES key is encrypted by an ISP public key with the application of the asymmetric algorithm RSA. This operation is handled by the TTP, and it is executed within the HSM. Figure 2: The proposed durable medium e-service in the form of a UML activity diagram. In the next stage, the following data are sent to the ISP: hash of the document; link to the encrypted document stored in IPFS, and encrypted AES key. Based on those data, the ISP is able to decrypt the obtained AES key with its private RSA key. The AES key is applied to decrypt the document downloaded from the IPFS. Finally, the document is sent to the selected clients in an unencrypted form (e.g., using the secure channel established with the client, strengthened by two-factor authentication or multi-factor authentication, for example). It is worth mentioning that the document is signed by the TTP, proving its authenticity and integrity. The client reads the document and decides to accept or reject it. This decision, along with the client identifier and document hash, is transferred back to the TTP and placed by the TTP in the blockchain as a new transaction. This operation is repeated for each client (note that for more readability, the diagram shows the activities for one customer only). Finally, each of the \(n\) clients makes a decision, and \(n\)+1 transactions appear on the blockchain.