Muhammad Adrezo
This project aims to carry out watermarking and blockchain processes on image data. In the process, it consists of watermarking stages on the image, then the image data that has been watermarked will be converted to SHA-256. Furthermore, data in the form of SHA-256 will be sent to the Load Balancer where the Load Balancer will distribute the data to the Blockchain server. Blockchain servers will compete to generate new hashes and become masters of that data. The competition process adapts the consensus process that exists in bitcoin by getting the first 5 "0" numbers. The blockchain server that gets the first 5 "0" numbers will become the master of the data and other blockchain servers will still get the data but in copy (not as the master data). The blockchain architecture in this project is implemented using 1 server as a Load Balancer and 2 Blockchain servers.
Implementation of Blockchain in Storage Implementation of Image Watermarking with the application of SHA-256 in an effort to Secure Data Image
Project of Blockchain and CyberSAFE Training
By
Muhammad Adrezo
Description:
This project aims to carry out watermarking and blockchain processes on image data. In the process, it consists of watermarking stages on the image, then the image data that has been watermarked will be converted to SHA-256. Furthermore, data in the form of SHA-256 will be sent to the Load Balancer where the Load Balancer will distribute the data to the Blockchain server. Blockchain servers will compete to generate new hashes and become masters of that data. The competition process adapts the consensus process that exists in bitcoin by getting the first 5 "0" numbers. The blockchain server that gets the first 5 "0" numbers will become the master of the data and other blockchain servers will still get the data but in copy (not as the master data). The blockchain architecture in this project is implemented using 1 server as a Load Balancer and 2 Blockchain servers.
Project details
The server used consists of 3 servers, namely:
VPS 1 as Blockchain servers 110.239.68.10 pass: Bisaai123
VPS 2 as the server's Load Balancer 110.239.71.66 pass: B1s4411d
VPS 3 as Blockchain servers 110.239.69.130 pass: B1s4411d |
The following is the code from Blockchain.py on VPS1 and VPS 3:
import hashlib from flask import Flask from flask import request, jsonify import time
app = Flask(__name__)
def consensus(prev,data): nonce = None hash_ = None timestamp = str(time.time()) payload = '{"prev_hash": "' + prev + '", "data": "'+ data +'", "time": "'+ timestamp + '"}' for i in range(10000000): nonce = str(i).encode('utf-8') result = hashlib.sha256(bytes (payload, encoding='windows-1255') + nonce).hexdigest() if result[0:5] == '00000': nonce = i hash_ = result break return nonce, hash_
@app.route('/postTransaksi', methods=['POST']) def postTransaksi(): prev_hash = request.json['prev_hash'] data = request.json['data'] nonce, hash_ = consensus(prev_hash, data) task = { 'prev_hash': prev_hash, 'nonce': nonce, 'hash': hash_, 'data': data } return jsonify({'task': task}), 201
if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port='6592')
#nonce, hash_ = consensus('e5a4b0381d7a9b876a159617eaaeba5782942cff6174771f5d57ca3fe5d2cc67','A') #print(nonce) #print(hash_) |
The code above is a simple web application using the Flask framework. This code uses the "consensus" function to look up the fully qualified nonce and hash based on the data provided, and also has a "/postTransaction" route that accepts POST requests to perform a consensus operation and returns the result in JSON format.
The function "consensus(prev, data)" plays a role in finding the nonce and hash that are fully qualified. First, the current timestamp is retrieved using the time module. Next, the payload (data) is formed by concatenating the values "prev_hash", "data", and "timestamp" in JSON format. This function then loops 10 million times to try different nonce values. At each iteration, the nonce is converted to a string and encrypted with UTF-8. The payload encrypted along with the nonce is hashed using SHA-256. If the hash result has a "00000" prefix, the nonce and hash are qualified, and the nonce and hash values are stored. The loop is terminated after it finds the nonce and hash that satisfy the conditions.
The "/postTransaction" route is set using the @app.route('/postTransaction', methods=['POST']) decorator. When this route is accessed via a POST request, the "postTransaction()" function will be executed. This function retrieves the "prev_hash" and "data" values from the JSON data sent by the request. Next, the "consensus()" function is called with the "prev_hash" and "data" arguments to find the nonce and the fully qualified hash. The result is then stored in a "task" object which contains "prev_hash", "nonce", "hash", and "data". Finally, the consensus result is returned in JSON format using the "jsonify()" function with HTTP status code 201 (Created).
At the end of the code, there is a comment showing how to use the "consensus()" function directly by providing the arguments "prev_hash" and "data". The nonce and hash results are then printed using the "print()" statement.
To run this application, you can use the command app.run(debug=True, host='0.0.0.0', port='6592'). The application will run on host "0.0.0.0" and port "6592". You can access the "/postTransaction" route via a POST request and see the consensus results returned in JSON format.
The following is the code from LoadBalancer.py on VPS2:
import hashlib from flask import Flask from flask import request, jsonify import time import json import requests
app = Flask(__name__)
@app.route('/postTransaksi', methods=['POST']) def postTransaksi(): sertifikat = request.json['sertifikat'] prev_hash = request.json['prev_hash'] task = { 'data': sertifikat, 'prev_hash': prev_hash } vm1 = requests.post('http://110.239.68.10:6592/postTransaksi', json = task) vm2 = requests.post('http://110.239.69.130:6592/postTransaksi', json = task) response_vm1 = json.loads(vm1.text) response_vm2 = json.loads(vm2.text) if(int(response_vm1['task']['nonce']) > int(response_vm1['task']['nonce'])): print("VM1 Menang") else: print("VM2 Menang") return jsonify(response_vm2), 201 return
if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port='6592') |
The code you provided is a simple web application using the Flask framework. This code includes a "/postTransaction" route that accepts POST requests and sends JSON data to two different virtual machines (VMs) to perform consensus operations. The results will be compared to determine which VM wins in consensus.
In the first lines, several required modules and libraries are imported, including hashlib, Flask, request, jsonify, time, json, and requests.
In line 8, the Flask instance is created using "name" as the application name. In lines 10-27, the "postTransaction()" function is defined in response to when the "/postTransaction" route is accessed via a POST request. This function retrieves the "certificate" and "prev_hash" values from the JSON data sent by the POST request. Those values are then used to form a "task" object. Next, the "requests.post()" function is used to send POST requests to two different VMs using the appropriate IP addresses and ports. The "task" object is sent in JSON format using the "json" parameter in the POST request.
On lines 29-30, the responses from the first and second VM are parsed from JSON format into Python objects using the "json.loads()" function. The response will contain the results of the consensus operations performed in the respective VMs. In lines 32-35, the consensus results from each VM are compared based on the nonce value. If the nonce of the first VM is greater than the nonce of the second VM, it prints "VM1 Wins", otherwise it prints "VM2 Wins". On lines 37-38, the response from the second VM is returned as the response from the "/postTransaction" route in JSON format, using the "jsonify()" function. HTTP status code 201 (Created) is also included. On lines 41-43, the Flask application is run using app.run(debug=True, host='0.0.0.0', port='6592'). The application will run on host "0.0.0.0" and port "6592".
By running this application, when the "/postTransaction" route is accessed via a POST request, the JSON data containing "certificate" and "prev_hash" will be sent to two different VMs. Consensus results from each VM will be compared to determine which VM wins. The response from the second VM will be returned as the response from the "/postTransaction" route.
Process of the Project
It consists of 2 main processes, namely watermarking the image and sending data to the blockchain to determine who is the winner (has the right to become the master of the existing data).
Following are the steps in this project:
1. Image data will be processed first for watermarking to do security.
Program code to process watermark, SHA-256 and send data to Load Balancer (Blockchain):
import requests import json from PIL import Image, ImageDraw, ImageFont import hashlib import binascii
# Adding Watermark on image gambar = None def add_watermark(image_path, watermark_text, output_path): # Open image image = Image.open(image_path)
# Buat salinan gambar watermark_image = image.copy()
# Add watermark text draw = ImageDraw.Draw(watermark_image) width, height = image.size font = ImageFont.truetype("arial.ttf", 36) # Replace with the appropriate font path text_bbox = draw.textbbox((0, 0), watermark_text, font=font) x = width - text_bbox[2] - 10 # X coordinate for watermark text y = height - text_bbox[3] - 10 # Y coordinate for watermark text #print(x,y) draw.text((x, y), watermark_text, font=font, fill=(255, 255, 255, 128))
# Save image with watermark #print(list(watermark_image.getdata())) global gambar gambar = list(watermark_image.getdata()) watermark_image.save(output_path) print("Watermark berhasil ditambahkan pada gambar.")
#mengubah data gambar ke SHA-256 def get_sha256_hash(string): # Membuat objek hasher SHA-256 sha256_hasher = hashlib.sha256()
# Mengubah string menjadi bytes dan mengupdate hasher sha256_hasher.update(string.encode('utf-8'))
# Mendapatkan nilai hash dalam bentuk heksadesimal sha256_hash = sha256_hasher.hexdigest()
return sha256_hash
# Tambahkan watermark pada gambar add_watermark("tulips.jpg", "Watermark Text", "gambar_watermarked.jpg") gambar_string = ''.join(str(x) for x in gambar) print(type(gambar_string))
# Mengubah data gambar ke SHA-256: sha256_hash_gambar = get_sha256_hash(gambar_string) #print("String:", gambar_string) print("SHA-256 Hash:", sha256_hash_gambar) print(type(sha256_hash_gambar))
#Mengirim data ke server (LoadBalancer) url = "http://110.239.71.66:6592/postTransaksi"
payload = json.dumps({ "sertifikat": sha256_hash_gambar, "prev_hash": "e5a4b0381d7a9b876a159617eaaeba5782942cff6174771f5d57ca3fe5d2cc67" }) headers = { 'Content-Type': 'application/json' }
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text) |
Image before watermarking Image after watermarking
2. After that the image data will be converted into SHA-256 form.
Image data (pixel value) in string form
(255, 226, 156)(255, 227, 154)(255, 227, 153)(254, 227, 148)(253, 224, 144)(251, 223, 139)(250, 220, 134)(249, 219, 129)(251, 217, 128)(251, 217, 127)(253, 217, 129)(253, 217, 129)(255, 217, 134)(255, 217, 134)(255, 218, 137)(255, 218, 133)(255, 222, 132)(255, 223, 126)(255, 223, 126)(255, 222, 122)(255, 222, 119)(254, 221, 114)(254, 221, 114)(254, 222, 113)(255, 225, 114)(255, 225, 114)(255, 226, 116)(255, 227, 117)(255, 225, 119)(255, 225, 119)(253, 224, 120)(253, 225, 115)(254, 230, 108)(254, 230, 104)(254, 230, 108)(254, 229, 111)(255, 227, 117)(255, 224, 117)(255, 222, 120)(255, 220, 119)(255, 217, 115)(255, 214, 109)(255, 209, 101)(255, 205, 90)(255, 203, 85)(254, 200, 76)(252, 197, 68)(251, 192, 72)(255, 189, 95)(255, 189, 108)(255, 192, 114)(255, 194, 120)(255, 197, 127)(255, 200, 133)(255, 204, 138)(255, 207, 141)(255, 212, 144)(253, 215, 144)(254, 216, 143)(255, 219, 141)(254, 222, 139)(253, 221, 134)(255, 221, 132)(255, 220, 130)(255, 220, 129)(255, 220, 129)(255, 221, 129)(254, 223, 130)(252, 224, 127)(250, 224, 127)(251, 223, 124)(252, 223, 123)(255, 222, 124)(255, 221, 120)(255, 221, 120)(255, 221, 116)(255, 220, 115)(255, 221, 114)(255, 221, 112)(255, 223, 108)(254, 226, 101)(252, 227, 98)(254, 226, 100)(254, 226, 100)(253, 225, 99)(252, 225, 96)(252, 224, 91)(252, 224, 88)(255, 228, 85)(255, 227, 83)(254, 226, 80)(253, 225, 81)(253, 224, 86)(253, 223, 89)(254, 223, 96)(255, 222, 102)(255, 220, 113)(255, 218, 111)(254, 216, 105)(251, 216, 98)(248, 217, 92)(249, 215, 91)(250, 210, 89)(252, 204, 94)(255, 195, 99)(255, 189, 109)(255, 181, 118)(255, 174, 124)(255, 168, 131)(255, 162, 132)(253, 157, 133)(254, 156, 129)(253, 155, 116)(251, 150, 104)(249, 142, 98)(249, 137, 91)(255, 132, 88)(255, 126, 80)(255, 118, 69)(255, 112, 60)(248, 101, 47)(249, 106, 46)(251, 120, 52)(255, 138, 61)(254, 155, 70)(252, 169, 75)(252, 184, 85)(254, 197, 94)(255, 204, 103)(254, 211, 109)(255, 217, 114)(255, 223, 118)(253, 226, 119)(250, 228, 119)(249, 226, 122)(249, 226, 124)(254, 228, 131)(255, 227, 135)(255, 225, 142)(255, 224, 145)(254, 222, 149)(250, 220, 150)(247, 218, 152)(246, 217, 151)(249, 211, 146)(247, 206, 142)(246, 196, 143)(244, 188, 141)(244, 179, 141)(246, 172, 137)(246, 166, 133)(248, 163, 126)(255, 164, 119)(254, 163, 108)(255, 161, 99)(253, 162, 89)(255, 165, 87)(255, 171, 86)(255, 178, 90)(255, 182, 91)(255, 184, 90)(255, 181, 84)(252, 178, 81)(251, 178, 76)(253, 175, 75)(250, 171, 70)(245, 163, 64)(241, 154, 59)(237, 143, 55)(232, 133, 52)(225, 118, 48)(221, 108, 48)(224, 103, 56)(225, 102, 61)(227, 98, 66)(226, 95, 65)(237, 97, 70)(246, 104, 82)(255, 114, 97)(255, 122, 113)(255, 127, 125)(255, 131, 134)(255, 137, 142)(255, 142, 144)(255, 153, 152)(253, 159, 149)(252, 166, 143)(252, 169, 135)(253, 172, 127)(255, 174, 119)(255, 176, 113)(255, 179, 106)(255, 180, 98)(255, 180, 88)(255, 178, 79)(255, 178, 70)(255, 178, 66)(255, 181, 63)(255, 181, 63)(255, 180, 62)(255, 180, 68)(255, 179, 72)(255, 179, 78)(253, 177, 81)(251, 178, 86)(250, 181, 90)(252, 185, 96)(254, 189, 97)(255, 189, 92)(255, 189, 90)(254, 189, 89)(254, 189, 89)(255, 185, 90)(253, 180, 88)(252, 170, 86)(254, 162, 87)(252, 144, 80)(255, 132, 81)(255, 113, 81)(255, 94, 76)(255, 75, 74)(255, 63, 72)(255, 55, 75)(255, 57, 69)(253, 68, 63)(254, 88, 64)(255, 112, 72)(255, 136, 81)(255, 155, 87)(255, 172, 92)(254, 186, 103)(252, 196, 113)(254, 200, 126)(253, 203, 134)(254, 204, 143)(253, 203, 142)(249, 197, 137)(245, 194, 129)(246, 193, 125)(250, 193, 116)(252, 182, 94)(254, 180, 85)(251, 177, 80)(248, 176, 78)(247, 175, 75)(246, 178, 77)(248, 181, 77)(247, 184, 79)(240, 183, 78)(239, 186, 80)(238, 191, 87)(239, 196, 92)(240, 203, 99)(242, 209, 106)(245, 213, 112)(243, 217, 124)(246, 219, 148)(245, 221, 161)(247, 222, 168)(250, 224, 175)(252, 224, 184)(252, 224, 187)(252, 221, 190)(254, 220, 192)(250, 215, 187)(250, 211, 182)(249, 206, 172)(248, 203, 164)(249, 200, 159)(250, 199, 152)(250, 197, 145)(245, 199, 139)(237, 201, 127)(231, 206, 122)(230, 210, 121)(225, 212, 116)(219, 212, 108)(219, 212, 105)(225, 213, 103)(232, 214, 104)(240, 208, 107)(246, 208, 111)(254, 206, 121)(255, 207, 128)(255, 207, 133)(251, 206, 138)(247, 207, 145)(247, 210, 142)(251, 212, 137)(251, 212, 133)(252, 212, 140)(252, 212, 143)(252, 213, 146)(253, 214, 145)(253, 215, 140)(254, 218, 132)(255, 219, 122)(255, 219, 112)(255, 218, 104)(255, 215, 99)(255, 213, 98)(255, 211, 99)(255, 211, 103)(255, 210, 103)(255, 205, 94)(255, 203, 90)(255, 197, 86)(255, 191, 81)(253, 185, 76)(253, 181, 73)(252, 178, 71)(253, 176, 70)(253, 174, 71)(251, 174, 70)(250, 172, 72)(249, 176, 74)(253, 179, 82)(253, 183, 85)(255, 185, 89)(255, 187, 88)(254, 187, 82)(253, 187, 75)(252, 185, 70)(250, 184, 61)(250, 186, 54)(250, 189, 47)(248, 192, 45)(246, 195, 42)(242, 195, 43)(241, 195, 47)(240, 193, 51)(239, 189, 56)(244, 185, 65)(248, 185, 72)(249, 177, 75)(250, 166, 80)(254, 151, 93)(255, 145, 102)(252, 142, 107)(249, 144, 114)(251, 149, 127)(254, 159, 141)(255, 169, 155)(255, 178, 163)(255, 188, 171)(255, 195, 170)(255, 203, 170)(255, 211, 165)(255, 215, 159)(254, 219, 151)(255, 222, 150)(254, 225, 145)(255, 226, 146)(254, 228, 143)(255, 230, 140)(255, 230, 137)(255, 231, 133)(255, 231, 131)(255, 230, 130)(255, 230, 130)(255, 229, 134)(254, 228, 133)(254, 224, 134)(253, 224, 132)(251, 222, 128)(251, 223, 124)(251, 222, 122)(253, 222, 116)(254, 222, 111)(255, 222, 107)(255, 222, 107)(255, 222, 107)(255, 220, 106)(255, 220, 106)(255, 220, 106)(255, 220, 106)(255, 220, 106)(255, 220, 106)(254, 221, 106)(254, 221, 106)(254, 223, 107)(255, 224, 108)(255, 226, 108)(254, 226, 116)(255, 227, 133)(255, 228, 141)(255, 229, 144)(255, 231, 146)(255, 231, 147)(255, 230, 146)(253, 231, 146)(252, 230, 145)(252, 230, 145)(252, 230, 145)(253, 229, 143)(252, 228, 140)(251, 225, 138)(248, 223, 133)(246, 219, 128)(248, 216, 131)(249, 205, 132)(251, 202, 136)(249, 198, 141)(248, 196, 146)(247, 194, 154)(248, 194, 160)(248, 193, 163)(249, 194, 164)(249, 193, 158)(251, 197, 153)(253, 201, 144)(252, 202, 131)(250, 202, 117)(250, 205, 104)(254, 207, 99)(254, 211, 98)(255, 213, 108)(255, 214, 112)(255, 216, 116)(255, 220, 121)(255, 223, 123)(255, 223, 120)(253, 222, 114)(251, 219, 108)(248, 215, 100)(250, 210, 97)(250, 202, 100)(251, 194, 104)(253, 186, 115)(253, 178, 121)(253, 170, 128)(254, 163, 132)(250, 147, 128)(249, 142, 124)(247, 140, 120)(251, 142, 119)(254, 144, 117)(255, 143, 113)(253, 134, 102)(250, 126, 92)(247, 112, 82)(245, 100, 71)(240, 84, 61)(241, 74, 55)(250, 70, 56)(255, 70, 58)(255, 68, 64)(255, 68, 62)(255, 71, 63)(255, 72, 59)(255, 69, 54)(251, 68, 50)(251, 66, 46)(254, 64, 48)(255, 61, 52)(255, 59, 55)(255, 54, 60)(255, 53, 60)(255, 55, 65)(255, 63, 67)(255, 75, 72)(255, 90, 78)(255, 105, 86)(251, 118, 87)(242, 132, 83)(239, 145, 84)(242, 157, 90)(242, 168, 93)(238, 177, 94)(236, 186, 97)(237, 196, 104)(238, 203, 109)(241, 207, 117)(244, 210, 120)(250, 211, 120)(253, 208, 117)(255, 202, 109)(255, 196, 100)(255, 191, 92)(255, 190, 86)(251, 190, 83)(249, 189, 77)(247, 183, 73)(246, 179, 66)(245, 172, 59)(245, 168, 52)(245, 164, 49)(246, 162, 46)(251, 164, 51)(250, 162, 52)(247, 161, 52)(247, 162, 56)(249, 163, 60)(250, 168, 68)(254, 172, 73)(254, 176, 75)(246, 172, 63)(246, 176, 64)(245, 179, 69)(246, 185, 79)(246, 191, 91)(247, 198, 105)(248, 204, 115)(245, 207, 122)(249, 217, 132)(249, 221, 137)(254, 226, 142)(255, 230, 143)(255, 231, 144)(255, 231, 139)(255, 232, 140)(255, 232, 142)(254, 233, 152)(253, 234, 157)(255, 234, 156)(255, 234, 154)(255, 233, 153)(255, 231, 147)(255, 227, 144)(254, 226, 142)(254, 227, 140)(253, 226, 139)(252, 226, 139)(252, 226, 139)(252, 228, 140)(253, 229, 141)(254, 230, 142)(254, 230, 142)(255, 230, 146)(255, 230, 146)(255, 230, 146)(255, 230, 145)(255, 228, 138)(255, 228, 131)(255, 226, 120)(255, 225, 109)(253, 222, 97)(252, 220, 85)(251, 215, 75)(247, 212, 68)(247, 209, 64)(247, 209, 64)(251, 210, 70)(249, 211, 74)(250, 216, 90)(249, 219, 95)(252, 222, 102)(253, 222, 105)(253, 224, 107)(251, 224, 111)(253, 225, 118)(253, 226, 123)(254, 228, 131)(254, 229, 136)(255, 231, 141)(255, 233, 147)(255, 234, 151)(255, 233, 153)(255, 232, 156)(255, 232, 152)(255, 233, 143)(255, 232, 136)(255, 230, 130)(255, 227, 123)(255, 226, 118)(255, 225, 112)(255, 222, 106)(253, 221, 102)(250, 215, 99)(248, 211, 97)(248, 204, 97)(250, 198, 97)(253, 187, 100)(252, 177, 96)(246, 164, 90)(246, 154, 81)(252, 145, 73)(255, 147, 70)(255, 152, 73)(253, 157, 71)(253, 162, 71)(254, 170, 71)(255, 178, 69)(255, 185, 67)(255, 188, 64)(255, 192, 65)(255, 198, 72)(255, 204, 78)(255, 207, 88)(255, 211, 93)(255, 212, 100)(254, 212, 100)(255, 212, 99)(254, 213, 99)(255, 213, 101)(253, 215, 106)(253, 216, 112)(252, 218, 118)(254, 220, 123)(254, 221, 126)(248, 214, 124)(248, 214, 124)(250, 213, 124)(251, 214, 125)(254, 213, 123)(251, 210, 118)(250, 205, 114)(250, 201, 108)(252, 191, 100)(252, 185, 94)(250, 179, 87)(248, 173, 80)(246, 166, 69)(243, 160, 58)(239, 154, 47)(235, 151, 37)(237, 156, 38)(242, 168, 47)(249, 180, 59)(252, 191, 74)(250, 198, 88)(249, 205, 100)(253, 211, 113)(251, 216, 122)(251, 220, 129)(249, 222, 131)(253, 223, 133)(254, 224, 134)(255, 224, 133)(255, 221, 131)(253, 218, 126)(254, 215, 122)(254, 211, 119)(251, 205, 111)(247, 197, 102)(246, 192, 94)(248, 190, 91)(249, 187, 86)(246, 182, 82)(243, 178, 76)(255, 226, 156)(255, 227, 154)(255, 227, 153)(254, 227, 148)(254, 225, 145)(252, 224, 140)(252, 222, 136)(251, 221, 133)(251, 220, 130)(253, 219, 129)(253, 219, 130)(255, 219, 133)(255, 220, 136)(255, 220, 136)(255, 219, 138)(255, 221, 137)(255, 223, 135)(255, 224, 131)(255, 223, 129)(255, 223, 125)(255, 222, 122)(255, 222, 117)(254, 221, 114)(253, 221, 112)(255, 223, 112)(255, 223, 112)(255, 225, 113)(255, 225, 115)(255, 224, 116)(255, 224, 116)(255, 224, 118)(252, 225, 112)(253, 227, 106)(253, 229, 103)(254, 228, 107)(254, 227, 110)(254, 226, 116)(255, 224, 116)(255, 221, 117)(255, 219, 118)(255, 216, 116)(255, 213, 109)(255, 208, 102)(254, 204, 93)(253, 200, 86)(253, 197, 78)(252, 194, 71)(250, 188, 75)(255, 185, 97)(255, 184, 108)(255, 188, 115)(255, 191, 120)(254, 193, 126)(255, 197, 133)(254, 203, 138)(254, 206, 142)(254, 210, 145)(252, 213, 144)(254, 216, 143)(254, 218, 140)(253, 221, 138)(253, 221, 134)(254, 220, 130)(255, 220, 128)(255, 219, 128)(255, 220, 127)(255, 221, 129)(253, 223, 127)(252, 224, 127)(250, 224, 127)(251, 223, 124)(252, 223, 123)(255, 222, 124)(255, 221, 120)(255, 221, 120)(255, 220, 115)(255, 220, 115)(255, 221, 114)(255, 222, 112)(255, 223, 108)(255, 225, 101)(254, 227, 98)(254, 226, 100)(255, 226, 100)(254, 225, 99)(253, 224, 96)(253, 223, 91)(252, 223, 85)(255, 226, 84)(255, 225, 82)(255, 225, 79)(253, 222, 79)(253, 221, 84)(253, 220, 87)(253, 219, 93)(255, 219, 99)(255, 215, 107)(255, 213, 108)(253, 213, 100)(251, 212, 93)(250, 212, 89)(248, 208, 86)(248, 203, 86)(251, 197, 89)(253, 188, 96)(255, 181, 105)(255, 173, 111)(255, 166, 119)(254, 160, 122)(253, 155, 126)(250, 154, 129)(251, 153, 124)(251, 153, 114)(248, 150, 103)(247, 145, 97)(250, 139, 93)(254, 136, 88)(255, 131, 81)(255, 122, 71)(255, 116, 61)(251, 111, 52)(250, 115, 51)(253, 126, 55)(255, 143, 63)(254 |
Image data is in SHA-256 form
76c6572319a608f9c23060a5716e883011aa065a0f85d8686d262899fbc8a5a4 |
3. Image data that is already in the form of SHA-256 will be sent to the Load Balancer.
4. Then the Load Balancer will send data to VPS 1 and VPS 3 as a Blockchain server where later VPS1 and VPS 3 will compete to form a hash.
5. VPS 1 and VPS 3 will compete to get the first 5 "0" numbers. The Blockchain server that first gets 5 zeros will be the winner and has the right to become the master of the data, and the other Blockchain still has the right to write down the data but becomes a copy of the master
Screenshot of the blockchain process:
Screenshot when the program is run for the watermarking process, sha-256 and POST (send data) to the Load Balancer.
Screenshot while the Blockchain server is processing to determine a new hash
Screenshot Load Balancer server determines which Blockchain server has the right to be the master