├── .gitignore ├── Dependency ├── .libs_cffi_backend │ └── libffi-806b1a9d.so.6.0.4 ├── AllDependencies.zip ├── JWT.zip └── SQL.zip ├── Lambda ├── AuthApi.py ├── BankApi.py ├── BankPaymentProcessor.py ├── GetTransInfo.py ├── PaymentProcessor.py ├── TA_Api.py └── key.pem ├── LocalServer └── LocalServer.py ├── README.md ├── S3Bucket ├── Private │ ├── Dcoder_Compiler.apk │ ├── Landing.html │ ├── Service_Disabler.apk │ └── YouTube_Vanced.apk └── Public │ ├── Login.html │ ├── Register.html │ ├── RegisterGull&Bull.html │ ├── css │ ├── RegisterGull&Bull.css │ ├── landing.css │ ├── login.css │ └── styles.css │ ├── images │ └── photo-1494548162494-384bba4ab999.jfif │ ├── index.html │ └── video │ └── video.mp4 ├── Simplified-Zero-Knowledge-Proof-Identity-Verification.py ├── Zero-Knowledge-Proofs-Security.pdf ├── Zero-Knowledge-Proofs-Security.pptx └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | venv/ -------------------------------------------------------------------------------- /Dependency/.libs_cffi_backend/libffi-806b1a9d.so.6.0.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Dependency/.libs_cffi_backend/libffi-806b1a9d.so.6.0.4 -------------------------------------------------------------------------------- /Dependency/AllDependencies.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Dependency/AllDependencies.zip -------------------------------------------------------------------------------- /Dependency/JWT.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Dependency/JWT.zip -------------------------------------------------------------------------------- /Dependency/SQL.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Dependency/SQL.zip -------------------------------------------------------------------------------- /Lambda/AuthApi.py: -------------------------------------------------------------------------------- 1 | from boto.cloudfront.distribution import Distribution 2 | from boto.cloudfront import CloudFrontConnection 3 | from botocore.signers import CloudFrontSigner 4 | import datetime 5 | import pymysql 6 | import random 7 | import struct 8 | import boto3 #Maybe Remove 9 | import json 10 | import math 11 | import jwt 12 | import rsa 13 | import os 14 | 15 | def gen_Url(): 16 | expire_date = (datetime.datetime.utcnow() + datetime.timedelta(seconds=URL_EXPIRE_TIME)).strftime('%Y-%m-%d %H:%M:%S') 17 | expire_date = datetime.datetime.strptime(expire_date, '%Y-%m-%d %H:%M:%S') 18 | cf_signer = CloudFrontSigner(key_id, rsa_signer) 19 | return cf_signer.generate_presigned_url(url, date_less_than=expire_date) 20 | 21 | def generate_token(username): 22 | payload = { 23 | 'user_id': username, 24 | 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=JWT_EXP_DELTA_SECONDS) 25 | } 26 | gen_token = jwt.encode(payload, JWT_SECRET, JWT_ALGORITHM) 27 | return gen_token 28 | 29 | def verify_token(token): 30 | try: 31 | decoded = json.loads(json.dumps(jwt.decode(token, JWT_SECRET, JWT_ALGORITHM))) 32 | return 0, decoded['user_id'], decoded['exp'] 33 | except: 34 | return -1, '', 0 35 | 36 | def rsa_signer(message): 37 | private_key = open('key.pem', 'r').read() 38 | return rsa.sign(message, rsa.PrivateKey.load_pkcs1(private_key.encode('utf8')),'SHA-1') 39 | 40 | def gen_Secure_Random(min, max): 41 | systemRandom = random.SystemRandom() 42 | return systemRandom.randint(min, max) 43 | 44 | def compute_Identification_Verification(alpha, response, public_Key, challenge, p): 45 | return pow(alpha, response, p) * pow(public_Key, challenge, p) % p 46 | 47 | 48 | # 49 | # 50 | #HANDLER STARTS HERE 51 | # 52 | # 53 | 54 | endpoint = 'DB_ENDPOINT' 55 | db_username = 'DB_USER' 56 | db_password = 'DB_PASSWORD' 57 | database_name = 'DB_NAME' 58 | url = "AUENTICATED_URL" 59 | key_id = 'APKAJKUYEXAMPLE7RD0A' 60 | JWT_SECRET = 'Some 2048 Char String' 61 | JWT_ALGORITHM = 'HS256' 62 | JWT_EXP_DELTA_SECONDS = 3600 63 | URL_EXPIRE_TIME = 480 64 | 65 | def lambda_handler(event, context): 66 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 67 | cursor = connection.cursor() 68 | 69 | if event["Code"] == 250: 70 | 71 | username = event["Username"] 72 | P_Val = int(event["P_Val"]) 73 | Q_Val = int(event["Q_Val"]) 74 | A_Val = int(event["A_Val"]) 75 | V_Val = int(event["V_Val"]) 76 | cursor.execute("Select Count(username) From Users Where username=%s", username) 77 | row = cursor.fetchone() 78 | if row[0] == 0: 79 | cursor.execute("INSERT INTO Users (username, p, q, a, v) VALUES (%s, %s, %s, %s, %s)", (username, P_Val, Q_Val, A_Val, V_Val)) 80 | connection.commit() 81 | return{ 82 | 'code': 200, 83 | 'token': generate_token(username), 84 | 'username': username, 85 | 'url': gen_Url(), 86 | 'message': "User Added Into Users Table", 87 | 'P_Val': P_Val, 88 | 'Q_Val': Q_Val, 89 | 'A_Val': A_Val, 90 | 'V_Val': V_Val 91 | } 92 | else: 93 | return{ 94 | 'code': 500, 95 | "message": "User Already Exists", 96 | 'user': username 97 | } 98 | elif event["Code"] == 350: 99 | 100 | username = event["Username"] 101 | cursor.execute("Select Count(username) From Users Where username=%s", username) 102 | row = cursor.fetchone() 103 | if row[0] == 1: 104 | cursor.execute("SELECT p, q, a, v FROM Users WHERE username=%s", username) 105 | row = cursor.fetchone() 106 | P = row[0] 107 | Q = row[1] 108 | A = row[2] 109 | V = row[3] 110 | return{ 111 | 'code': 200, 112 | 'MESSAGE': "User Found These are you variables", 113 | 'P': P, 114 | 'Q': Q, 115 | 'A': A, 116 | 'V': V 117 | } 118 | else: 119 | return{ 120 | 'code': 500, 121 | 'MESSAGE': "User Not Found" 122 | } 123 | elif event["Code"] == 450: 124 | 125 | username = event["Username"] 126 | commitment = event["Commit"] 127 | cursor.execute("Select Count(username) From Users Where username=%s", username) 128 | row = cursor.fetchone() 129 | if row[0] == 1: 130 | cursor.execute("Select q From Users Where username=%s", username) 131 | row = cursor.fetchone() 132 | q = row[0] 133 | bits = math.floor(math.log(q, 2)+1) 134 | t = bits - 1 135 | challenge = gen_Secure_Random(1, math.pow(2,t)) 136 | cursor.execute("UPDATE Users SET commitment=%s, r=%s WHERE username=%s", (commitment, challenge, username)) 137 | connection.commit() 138 | return{ 139 | 'code': 200, 140 | 'MESSAGE': "Found User", 141 | 'Challenge': challenge 142 | } 143 | else: 144 | return{ 145 | 'code': 500, 146 | 'MESSAGE': "User Not Found", 147 | 'user': username 148 | } 149 | elif event["Code"] == 550: 150 | 151 | username = event["Username"] 152 | y = int(event["Y"]) 153 | cursor.execute("Select Count(username) From Users Where username=%s", username) 154 | row = cursor.fetchone() 155 | if row[0] == 1: 156 | cursor.execute("Select p, q, a, v, r, commitment From Users Where username=%s", username) 157 | row = cursor.fetchone() 158 | p = row[0] 159 | q = row[1] 160 | a = row[2] 161 | v = row[3] 162 | r = row[4] 163 | commit = row[5] 164 | verification = compute_Identification_Verification(a, y, v, r, p) 165 | if commit == verification: 166 | return { 167 | 'code': 200, 168 | 'msg': "LogIn Success", 169 | 'token': generate_token(username) 170 | } 171 | else: 172 | return { 173 | 'code': 500, 174 | 'msg': "Wrong Passsword" 175 | } 176 | else: 177 | return{ 178 | "message": "User Not Found", 179 | 'username': username 180 | } 181 | elif event["Code"] == 650: 182 | token = event['cookie'] 183 | valid, username, expiry = verify_token(token) 184 | if valid < 0: 185 | return { 186 | 'Message': "Invaild Token" 187 | } 188 | else: 189 | P_Val = int(event["P_Val"]) 190 | Q_Val = int(event["Q_Val"]) 191 | A_Val = int(event["A_Val"]) 192 | V_Val = int(event["V_Val"]) 193 | cursor.execute("Select Count(username) From Users Where username=%s", username) 194 | row = cursor.fetchone() 195 | if row[0] == 0: 196 | return { 197 | 'code': 500, 198 | 'Message': "Registration Utilizing Login Functionality Is Prohibited" 199 | } 200 | else: 201 | cursor.execute("UPDATE Users SET p = %s, q = %s, a = %s, v = %s, r = NULL, commitment = NULL WHERE username = %s;", (P_Val, Q_Val, A_Val, V_Val, username)) 202 | connection.commit() 203 | return{ 204 | 'code': 200, 205 | 'MESSAGE': "User Variables Have Been Rotated", 206 | 'url': gen_Url() 207 | } 208 | else: 209 | return -1 -------------------------------------------------------------------------------- /Lambda/BankApi.py: -------------------------------------------------------------------------------- 1 | 2 | import datetime 3 | import pymysql 4 | import random 5 | import struct 6 | import json 7 | import math 8 | import os 9 | 10 | def gen_Secure_Random(min, max): 11 | systemRandom = random.SystemRandom() 12 | return systemRandom.randint(min, max) 13 | 14 | def compute_Identification_Verification(alpha, response, public_Key, challenge, p): 15 | return pow(alpha, response, p) * pow(public_Key, challenge, p) % p 16 | 17 | 18 | # 19 | # 20 | #HANDLER STARTS HERE 21 | # 22 | # 23 | 24 | endpoint = 'DB_ENDPOINT' 25 | db_username = 'DB_USER' 26 | db_password = 'DB_PASSWORD' 27 | database_name = 'DB_NAME' 28 | 29 | def lambda_handler(event, context): 30 | 31 | if event["Code"] == 250: 32 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 33 | cursor = connection.cursor() 34 | username = event["Username"] 35 | P_Val = int(event["P_Val"]) 36 | Q_Val = int(event["Q_Val"]) 37 | A_Val = int(event["A_Val"]) 38 | V_Val = int(event["V_Val"]) 39 | cursor.execute("Select Count(username) From Users Where username=%s", username) 40 | row = cursor.fetchone() 41 | if row[0] == 0: 42 | cursor.execute("INSERT INTO Users (username, p, q, a, v) VALUES (%s, %s, %s, %s, %s)", (username, P_Val, Q_Val, A_Val, V_Val)) 43 | connection.commit() 44 | return{ 45 | 'message': "User Added Into Users Table In Bank DB", 46 | 'code': 200 47 | } 48 | else: 49 | return{ 50 | 'message': "User Already Exists In Bank", 51 | 'username': username, 52 | 'code': 404 53 | } 54 | elif event["Code"] == 350: 55 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 56 | cursor = connection.cursor() 57 | username = event["Username"] 58 | cursor.execute("Select Count(username) From Users Where username=%s", username) 59 | row = cursor.fetchone() 60 | if row[0] == 1: 61 | cursor.execute("SELECT p, q, a, v FROM Users WHERE username=%s", username) 62 | row = cursor.fetchone() 63 | P = row[0] 64 | Q = row[1] 65 | A = row[2] 66 | V = row[3] 67 | return { 68 | 'code': 200, 69 | 'MESSAGE': "This is your variables", 70 | 'P': P, 71 | 'Q': Q, 72 | 'A': A, 73 | 'V': V 74 | } 75 | else: 76 | return{ 77 | 'MESSAGE': "User Not Found" 78 | } 79 | elif event["Code"] == 450: 80 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 81 | cursor = connection.cursor() 82 | username = event["Username"] 83 | commitment = event["Commit"] 84 | cursor.execute("Select Count(username) From Users Where username=%s", username) 85 | row = cursor.fetchone() 86 | if row[0] == 1: 87 | cursor.execute("Select q From Users Where username=%s", username) 88 | row = cursor.fetchone() 89 | q = row[0] 90 | bits = math.floor(math.log(q, 2)+1) 91 | t = bits - 1 92 | challenge = gen_Secure_Random(1, math.pow(2,t)) 93 | cursor.execute("UPDATE Users SET commitment=%s, r=%s WHERE username=%s", (commitment, challenge, username)) 94 | connection.commit() 95 | return{ 96 | 'code': 200, 97 | 'MESSAGE': "Generating Resonse", 98 | 'Challenge': challenge 99 | } 100 | else: 101 | return{ 102 | 'code': 404, 103 | 'MESSAGE': "User Not Found" 104 | } 105 | elif event["Code"] == 550: 106 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 107 | cursor = connection.cursor() 108 | msg = "Username Not Found" 109 | username = event["Username"] 110 | y = int(event["Y"]) 111 | cursor.execute("Select Count(username) From Users Where username=%s", username) 112 | row = cursor.fetchone() 113 | if row[0] == 1: 114 | cursor.execute("Select p, q, a, v, r, commitment From Users Where username=%s", username) 115 | row = cursor.fetchone() 116 | p = row[0] 117 | q = row[1] 118 | a = row[2] 119 | v = row[3] 120 | r = row[4] 121 | commit = row[5] 122 | verification = compute_Identification_Verification(a, y, v, r, p) 123 | if commit == verification: 124 | return { 125 | 'RESPONSE': "Bank Log In Success" 126 | } 127 | else: 128 | return { 129 | 'RESPONSE': "Wrong Passsword" 130 | } 131 | else: 132 | return{ 133 | "message": "User Not Found", 134 | 'username': username 135 | } 136 | else: 137 | return -1 138 | -------------------------------------------------------------------------------- /Lambda/BankPaymentProcessor.py: -------------------------------------------------------------------------------- 1 | import pymysql 2 | import random 3 | import math 4 | 5 | def gen_Secure_Random(min, max): 6 | systemRandom = random.SystemRandom() 7 | return systemRandom.randint(min, max) 8 | 9 | def compute_Identification_Verification(alpha, response, public_Key, challenge, p): 10 | return pow(alpha, response, p) * pow(public_Key, challenge, p) % p 11 | 12 | # 13 | # 14 | #HANDLER STARTS HERE 15 | # 16 | # 17 | 18 | endpoint = 'DB_ENDPOINT' 19 | db_username = 'DB_USER' 20 | db_password = 'DB_PASSWORD' 21 | database_name = 'DB_NAME' 22 | store = 'ZKStore' 23 | 24 | def lambda_handler(event, context): 25 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 26 | cursor = connection.cursor() 27 | # 28 | #Code 50 = Get User Variables From Bank Database 29 | # 30 | if event["Code"] == 50: 31 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 32 | cursor = connection.cursor() 33 | username = event["Username"] 34 | cursor.execute("Select Count(username) From Users Where username=%s", username) 35 | row = cursor.fetchone() 36 | if row[0] == 1: 37 | cursor.execute("SELECT p, q, a, v FROM Users WHERE username=%s", username) 38 | row = cursor.fetchone() 39 | P = row[0] 40 | Q = row[1] 41 | A = row[2] 42 | V = row[3] 43 | return { 44 | 'code': 200, 45 | 'P': P, 46 | 'Q': Q, 47 | 'A': A, 48 | 'V': V 49 | } 50 | else: 51 | return { 52 | 'code': 500, 53 | 'message': "Username Doesn't Exist With Our Bank. Please Consider Registering." 54 | } 55 | # 56 | #Code 150 = Establish Commitment For Login & Return Challege 57 | # 58 | elif event["Code"] == 150: 59 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 60 | cursor = connection.cursor() 61 | username = event["Username"] 62 | commitment = event["Commit"] 63 | cursor.execute("Select Count(username) From Users Where username=%s", username) 64 | row = cursor.fetchone() 65 | if row[0] == 1: 66 | cursor.execute("Select q From Users Where username=%s", username) 67 | row = cursor.fetchone() 68 | q = row[0] 69 | bits = math.floor(math.log(q, 2)+1) 70 | t = bits - 1 71 | challenge = gen_Secure_Random(1, math.pow(2,t)) 72 | cursor.execute("UPDATE Users SET commitment=%s, r=%s WHERE username=%s", (commitment, challenge, username)) 73 | connection.commit() 74 | return{ 75 | 'code': 200, 76 | 'message': "User Found!! Bank Payment Processor Challege", 77 | 'Challenge': challenge 78 | } 79 | else: 80 | return{ 81 | 'code': 404, 82 | 'message': "Username Doesn't Exist With Our Bank. Stop Messing Around!!" 83 | } 84 | # 85 | #Code 250 = Compute Verification 86 | # 87 | elif event["Code"] == 250: 88 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 89 | cursor = connection.cursor() 90 | username = event["Username"] 91 | y = int(event["Y"]) 92 | cursor.execute("Select Count(username) From Users Where username=%s", username) 93 | row = cursor.fetchone() 94 | if row[0] == 1: 95 | cursor.execute("Select p, q, a, v, r, commitment From Users Where username=%s", username) 96 | row = cursor.fetchone() 97 | p = row[0] 98 | q = row[1] 99 | a = row[2] 100 | v = row[3] 101 | r = row[4] 102 | commit = row[5] 103 | verification = compute_Identification_Verification(a, y, v, r, p) 104 | if commit == verification: 105 | total = float(event["price"]) 106 | recvUser = event["StoreId"] 107 | cursor.execute("INSERT INTO Transactions (username, transnumber, accountdebt, accountcredit) VALUES (%s, %s, %s, 0.00)", (username, gen_Secure_Random(1, math.pow(2, 16)), total)) 108 | cursor.execute("INSERT INTO Transactions (username, transnumber, accountdebt, accountcredit) VALUES (%s, %s, 0.00, %s)", (recvUser, gen_Secure_Random(1, math.pow(2, 16)), total)) 109 | connection.commit() 110 | return { 111 | 'code': 200, 112 | 'message': "Bank Processor Log In Success", 113 | 'total': total, 114 | 'StoreId': recvUser 115 | } 116 | else: 117 | return { 118 | 'code': 404, 119 | 'message': "Wrong Passsword" 120 | } 121 | 122 | else: 123 | return { 124 | 'message': "Username Doesn't Exist With Our Bank. Stop Messing Around!!", 125 | 'username': username 126 | } 127 | elif event["Code"] == 350: 128 | username = event['Username'] 129 | P_Val = int(event["P"]) 130 | Q_Val = int(event["Q"]) 131 | A_Val = int(event["A"]) 132 | V_Val = int(event["V"]) 133 | cursor.execute("Select Count(username) From Users Where username=%s", username) 134 | row = cursor.fetchone() 135 | if row[0] == 0: 136 | return { 137 | 'code': 500, 138 | 'Message': "Registration Utilizing Rotating Functionality Is Prohibited" 139 | } 140 | else: 141 | cursor.execute("UPDATE Users SET p = %s, q = %s, a = %s, v = %s, r = NULL, commitment = NULL WHERE username = %s;", (P_Val, Q_Val, A_Val, V_Val, username)) 142 | connection.commit() 143 | return{ 144 | 'code': 200, 145 | 'MESSAGE': "User Bank Variables Have Been Rotated", 146 | } 147 | else: 148 | return -1 -------------------------------------------------------------------------------- /Lambda/GetTransInfo.py: -------------------------------------------------------------------------------- 1 | import json 2 | import jwt 3 | import pymysql 4 | import datetime 5 | import array 6 | 7 | endpoint = 'DB_ENDPOINT' 8 | db_username = 'DB_USER' 9 | db_password = 'DB_PASSWORD' 10 | database_name = 'DB_NAME' 11 | JWT_SECRET = 'Some 2048 Char String' 12 | JWT_ALGORITHM = 'HS256' 13 | 14 | def verify_token(token): 15 | try: 16 | decoded = json.loads(json.dumps(jwt.decode(token, JWT_SECRET, JWT_ALGORITHM))) 17 | return 0, decoded['user_id'], decoded['exp'] 18 | except: 19 | return -1, '', 0 20 | 21 | def lambda_handler(event, context): 22 | token = event['cookie'] 23 | valid, username, expiry = verify_token(token) 24 | if valid < 0: 25 | return { 26 | 'Message': "Invaild Token" 27 | } 28 | else: 29 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 30 | cursor = connection.cursor() 31 | cursor.execute("Select Count(username) From Transactions Where username=%s", username) 32 | row = cursor.fetchone() 33 | length = row[0] 34 | if row[0] >= 1: 35 | cursor.execute("Select * From Transactions Where username=%s", username) 36 | row = cursor.fetchall() 37 | strings = [] 38 | for record in row: 39 | strings.append(str(record[0]) + ":" + str(record[1]) + ":" + str(record[2]) + ":" + str(record[3]) + ":" + str(record[4]) + ":") 40 | string = "" 41 | for strin in strings: 42 | string = string + strin 43 | return { 44 | 'length': length, 45 | 'string': string 46 | } -------------------------------------------------------------------------------- /Lambda/PaymentProcessor.py: -------------------------------------------------------------------------------- 1 | from boto.cloudfront.distribution import Distribution 2 | from boto.cloudfront import CloudFrontConnection 3 | from botocore.signers import CloudFrontSigner 4 | import datetime 5 | import json 6 | import jwt 7 | import rsa 8 | import boto3 9 | import random 10 | import math 11 | import pymysql 12 | 13 | client = boto3.client('lambda') 14 | JWT_SECRET = 'Some 2048 Char String' 15 | JWT_ALGORITHM = 'HS256' 16 | endpoint = 'DB_ENDPOINT' 17 | db_username = 'DB_USER' 18 | db_password = 'DB_PASSWORD' 19 | database_name = 'DB_NAME' 20 | key_id = 'APKAJKUYEXAMPLE7RD0A' 21 | URL_EXPIRE_TIME = 60 22 | connection = pymysql.connect(endpoint, user=db_username, passwd=db_password, db=database_name) 23 | cursor = connection.cursor() 24 | 25 | def gen_Url(url): 26 | expire_date = (datetime.datetime.utcnow() + datetime.timedelta(seconds=URL_EXPIRE_TIME)).strftime('%Y-%m-%d %H:%M:%S') 27 | expire_date = datetime.datetime.strptime(expire_date, '%Y-%m-%d %H:%M:%S') 28 | cf_signer = CloudFrontSigner(key_id, rsa_signer) 29 | return cf_signer.generate_presigned_url(url, date_less_than=expire_date) 30 | 31 | def rsa_signer(message): 32 | private_key = open('key.pem', 'r').read() 33 | return rsa.sign(message, rsa.PrivateKey.load_pkcs1(private_key.encode('utf8')),'SHA-1') 34 | 35 | def Invoke_Request(input): 36 | return client.invoke( 37 | FunctionName='arn:aws:lambda:us-east-1:NUMBER_HERE:function:YOUR_FUNCTIONS_NAME',#arn:aws:lambda:us-east-1:NUMBERS:function:invoke 38 | InvocationType='RequestResponse', # Use Event to not listen for response. 39 | Payload=json.dumps(input) 40 | ) 41 | 42 | def verify_token(token): 43 | try: 44 | decoded = json.loads(json.dumps(jwt.decode(token, JWT_SECRET, JWT_ALGORITHM))) 45 | return 0, decoded['user_id'], decoded['exp'] 46 | except: 47 | return -1, '', 0 48 | 49 | def gen_Secure_Random(min, max): 50 | systemRandom = random.SystemRandom() 51 | return systemRandom.randint(min, max) 52 | 53 | def lambda_handler(event, context): 54 | 55 | valid, username, expiry = verify_token(event['cookie']) 56 | if valid < 0: 57 | return { 58 | 'Message': "Invaild Token" 59 | } 60 | else: 61 | 62 | # 63 | #Code 50 = Get Variables From Bank 64 | # 65 | if event["Code"] == 50: 66 | 67 | requestInput = {'Username': event['Username'], 'Code': event['bankCode'] } 68 | return json.load(Invoke_Request(requestInput)['Payload']) 69 | # 70 | #Code 150 = Establish Commitment For Bank Login & Return Challege 71 | # 72 | elif event["Code"] == 150: 73 | requestInput = {'Username': event['Username'], 'Commit': event['Commit'], 'Code': event['bankCode'] } 74 | return json.load(Invoke_Request(requestInput)['Payload']) 75 | # 76 | #Code 250 = Compute Bank Verification 77 | # 78 | elif event["Code"] == 250: 79 | # 80 | #Implement Downloads Urls 81 | # 82 | requestInput = {'Username': event['Username'], 'Y': event['Y'], 'Code': event['bankCode'], 'price': event['price'], 'StoreId': 'ZKStore' } 83 | resp = json.load(Invoke_Request(requestInput)['Payload']) 84 | if resp['code'] == 200: 85 | cursor.execute("INSERT INTO Transactions (username, transnumber, ordertotal, productid) VALUES (%s, %s, %s, %s)", (username, gen_Secure_Random(1, math.pow(2, 16)), event['price'], event['prodId'])) 86 | connection.commit() 87 | if (event['prodId'] == 1): 88 | url = gen_Url("https://private.EXAMPLE.com/YouTube_Vanced.apk") 89 | elif (event['prodId'] == 2): 90 | url = gen_Url("https://private.EXAMPLE.com/Service_Disabler.apk") 91 | elif (event['prodId'] == 3): 92 | url = gen_Url("https://private.EXAMPLE.com/Dcoder_Compiler.apk") 93 | return { 'code': 200, 'Message': "Successful Payment", 'Url': url } 94 | return json.load(Invoke_Request(requestInput)['Payload']) 95 | # 96 | #Code 250 = Reestablish Bank Communications 97 | # 98 | elif event["Code"] == 350: 99 | requestInput = {'Username': event['Username'], 'P': event["P_Val"], 'Q': event["Q_Val"], 'A': event["A_Val"], 'V': event["V_Val"], 'Code': 350 } 100 | return json.load(Invoke_Request(requestInput)['Payload']) -------------------------------------------------------------------------------- /Lambda/TA_Api.py: -------------------------------------------------------------------------------- 1 | import json 2 | import math 3 | import random 4 | 5 | def is_Prime(prime): 6 | if (prime > 0 and prime < 4): 7 | return prime 8 | if (prime % 2 == 0): 9 | return 0 10 | i = 3 11 | while (prime % i != 0 and i < math.ceil(math.sqrt(prime))): 12 | i += 2 13 | if (prime % i != 0): 14 | return prime 15 | return 0 16 | 17 | def gen_Alpha_Q(min, p): 18 | pm1 = p - 1 19 | temp = pm1 20 | temp = temp / 2 21 | if (temp % 2 == 0): 22 | temp += 1 23 | for q in range(int(temp), min, -2): 24 | if (pm1 % q == 0): 25 | if (is_Prime(q) > 0): 26 | for alpha in range(pm1, 2, -1): 27 | if(pow(alpha, q, p) == 1): 28 | return alpha, q 29 | return 0, 0 30 | 31 | def get_Random_Prime(min, max): 32 | prime = 0 33 | while prime == 0: 34 | prime = gen_Secure_Random(min, max) 35 | prime = is_Prime(prime) 36 | return prime 37 | 38 | def gen_Secure_Random(min, max): 39 | systemRandom = random.SystemRandom() 40 | return systemRandom.randint(min, max) 41 | 42 | def lambda_handler(event, context): 43 | min_P_PrimeComplexity = pow(2,24) 44 | max_P_PrimeComplexity = pow(2,25) 45 | alpha = 0 46 | q = 0 47 | while alpha == 0 or q == 0: 48 | p = get_Random_Prime(min_P_PrimeComplexity, max_P_PrimeComplexity) 49 | alpha, q = gen_Alpha_Q(1, p) 50 | return { 51 | "P":p, 52 | "Q":q, 53 | "A":alpha 54 | } 55 | -------------------------------------------------------------------------------- /Lambda/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | YOUR KEY HERE 3 | -----END RSA PRIVATE KEY----- -------------------------------------------------------------------------------- /LocalServer/LocalServer.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, request, jsonify, make_response 2 | import requests 3 | import struct 4 | import random 5 | import math 6 | import os 7 | 8 | app = Flask(__name__) 9 | # For some reason only JSON objects are cached between requests. 10 | offset = {} 11 | 12 | @app.route('/', methods=['OPTIONS','POST']) 13 | def ReturnData(): 14 | 15 | response = make_response() 16 | if request.method == 'OPTIONS': 17 | 18 | response.headers.add("Access-Control-Allow-Origin", "*") 19 | return response 20 | elif request.method == 'POST': 21 | 22 | code = int(request.form['Code']) 23 | if code == 100: 24 | 25 | password = request.form['Password'] 26 | p = int(request.form['P']) 27 | q = int(request.form['Q']) 28 | alpha = int(request.form['A']) 29 | priv_Key = covert_String_Int(password, q) 30 | public_Key = compute_Public_Key(alpha, priv_Key, p, q) 31 | response = jsonify({"P": p, "Q": q, "A": alpha, "V": public_Key}) 32 | response.headers.add("Access-Control-Allow-Origin", "*") 33 | return response 34 | 35 | elif code == 200: 36 | 37 | p = int(request.form['P']) 38 | q = int(request.form['Q']) 39 | alpha = int(request.form['A']) 40 | offset['K'] = gen_Secure_Random(1, q - 1) 41 | r = compute_Public_Commitment(alpha, offset['K'], p) 42 | response = jsonify({"Commitment": r}) 43 | response.headers.add("Access-Control-Allow-Origin", "*") 44 | return response 45 | 46 | elif code == 300: 47 | 48 | q = int(request.form['Q']) 49 | challenge = int(request.form['R']) 50 | print(request.form['Pass']) 51 | priv_Key = covert_String_Int(request.form['Pass'], q) 52 | print("300: %s" % (priv_Key)) 53 | y = compute_Challenge_Response(offset['K'], priv_Key, challenge, q) 54 | response = jsonify({"Response": y}) 55 | response.headers.add("Access-Control-Allow-Origin", "*") 56 | return response 57 | 58 | def compute_Public_Key(alpha, priv_Key, p, q): 59 | return pow(alpha, q - priv_Key, p) 60 | 61 | def covert_String_Int(priv_Key, q): 62 | val = 1 63 | order = 1 64 | for char in priv_Key: 65 | val *= int(math.pow(ord(char), order)) 66 | order += 1 67 | return val % q 68 | 69 | def compute_Public_Commitment(alpha, offset, p): 70 | return pow(alpha, offset, p) 71 | 72 | def gen_Secure_Random(min, max): 73 | systemRandom = random.SystemRandom() 74 | return systemRandom.randint(min, max) 75 | 76 | def compute_Challenge_Response(offset, priv_Key, challenge, q): 77 | return offset + priv_Key * challenge % q 78 | 79 | if __name__ == '__main__': 80 | app.debug = True 81 | app.run(host = '127.0.0.1', port = 5000) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zero-Knowledge-Proof-Identity-Verification 2 | A Hash-less Adaptation of Schnorr's Digital Signature Algorithm Implemented in Python. 3 | 4 | -------------------------------------------------------------------------------- /S3Bucket/Private/Dcoder_Compiler.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/S3Bucket/Private/Dcoder_Compiler.apk -------------------------------------------------------------------------------- /S3Bucket/Private/Landing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Landing Page 6 | 7 | 8 | 9 | 10 | 324 | 325 | 326 |
327 |


328 | 329 | 330 | 331 | 332 |

Welcome to our online store 333 |



334 |
335 |
336 | Avatar
337 |
$5.99
338 | 339 |
340 |
341 | Avatar
342 |
$6.99
343 | 344 |
345 |
346 | Avatar
347 |
$7.99
348 | 349 |
350 |
351 |

352 | 355 |

356 | 366 | 379 |
380 |
381 |
382 |
383 |

Your Orders Are Listed Below

384 |
385 | 386 |
387 |
388 |
389 |
390 |
391 |
392 | 393 | -------------------------------------------------------------------------------- /S3Bucket/Private/Service_Disabler.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/S3Bucket/Private/Service_Disabler.apk -------------------------------------------------------------------------------- /S3Bucket/Private/YouTube_Vanced.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/S3Bucket/Private/YouTube_Vanced.apk -------------------------------------------------------------------------------- /S3Bucket/Public/Login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Login 9 | 10 | 11 | 12 | 214 | 215 | 216 |
217 |
218 |
219 |
220 | 221 | 222 | 223 |
224 |

Please Enter Your Username

225 |
226 | 227 | 228 |
229 |
230 |
231 |
232 | 233 | 254 | 255 | -------------------------------------------------------------------------------- /S3Bucket/Public/Register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Register 5 | 6 | 7 | 8 | 101 | 102 | 103 |
104 |
105 |
106 | 107 | 108 | 109 |
110 |

Please Register To Access The Website

111 |
112 | 113 |


114 | 115 |
116 |
117 |
118 | 119 | 120 | -------------------------------------------------------------------------------- /S3Bucket/Public/RegisterGull&Bull.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bank Registeration 6 | 7 | 8 | 9 | 10 | 118 | 119 | 120 |
121 |

122 |

123 |
124 |
125 |

Register For Our Online ZeroKnowledge Banking System

126 | 127 |
128 |
129 | 130 |
131 |
132 |
133 |
134 |

135 |
136 | 137 |
138 | 139 | 140 |

141 | 142 |
143 |
144 |
145 |
146 | 147 | -------------------------------------------------------------------------------- /S3Bucket/Public/css/RegisterGull&Bull.css: -------------------------------------------------------------------------------- 1 | 2 | /* BASIC */ 3 | 4 | 5 | body { 6 | font-family: "Poppins", sans-serif; 7 | height: 90vh; 8 | background-color: #035700; 9 | } 10 | 11 | a { 12 | color: #000000; 13 | display:inline-block; 14 | text-decoration: none; 15 | font-weight: 400; 16 | } 17 | 18 | h2 { 19 | text-align: center; 20 | font-size: 16px; 21 | font-weight: 600; 22 | text-transform: uppercase; 23 | display:inline-block; 24 | margin: 40px 8px 10px 8px; 25 | color: #cccccc; 26 | } 27 | 28 | 29 | 30 | /* STRUCTURE */ 31 | 32 | .wrapper { 33 | display: flex; 34 | align-items: center; 35 | flex-direction: column; 36 | justify-content: center; 37 | width: 95%; 38 | min-height: 100%; 39 | padding: 20px; 40 | } 41 | 42 | #formContent { 43 | -webkit-border-radius: 10px 10px 10px 10px; 44 | border-radius: 10px 10px 10px 10px; 45 | background: #fff; 46 | padding: 30px; 47 | width: 90%; 48 | max-width: 450px; 49 | position: relative; 50 | padding: 0px; 51 | -webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 52 | box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 53 | text-align: center; 54 | } 55 | 56 | #formFooter { 57 | background-color: #f6f6f6; 58 | border-top: 1px solid #dce8f1; 59 | padding: 25px; 60 | text-align: center; 61 | -webkit-border-radius: 0 0 10px 10px; 62 | border-radius: 0 0 10px 10px; 63 | } 64 | 65 | 66 | 67 | /* TABS */ 68 | 69 | h2.inactive { 70 | color: #cccccc; 71 | } 72 | 73 | h2.active { 74 | color: #0d0d0d; 75 | border-bottom: 2px solid #5fbae9; 76 | } 77 | 78 | 79 | 80 | /* FORM TYPOGRAPHY*/ 81 | 82 | input[type=button], input[type=submit], input[type=reset] { 83 | background-color: #000000; 84 | border: none; 85 | color: white; 86 | padding: 15px 80px; 87 | text-align: center; 88 | text-decoration: none; 89 | display: inline-block; 90 | text-transform: uppercase; 91 | font-size: 13px; 92 | -webkit-box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 93 | box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 94 | -webkit-border-radius: 5px 5px 5px 5px; 95 | border-radius: 5px 5px 5px 5px; 96 | margin: 5px 20px 40px 20px; 97 | -webkit-transition: all 0.3s ease-in-out; 98 | -moz-transition: all 0.3s ease-in-out; 99 | -ms-transition: all 0.3s ease-in-out; 100 | -o-transition: all 0.3s ease-in-out; 101 | transition: all 0.3s ease-in-out; 102 | } 103 | 104 | input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { 105 | background-color: #000203; 106 | } 107 | 108 | input[type=button]:active, input[type=submit]:active, input[type=reset]:active { 109 | -moz-transform: scale(0.95); 110 | -webkit-transform: scale(0.95); 111 | -o-transform: scale(0.95); 112 | -ms-transform: scale(0.95); 113 | transform: scale(0.95); 114 | } 115 | 116 | input[type=text] { 117 | background-color: #f6f6f6; 118 | border: none; 119 | color: #0d0d0d; 120 | padding: 15px 32px; 121 | text-align: center; 122 | text-decoration: none; 123 | display: inline-block; 124 | font-size: 16px; 125 | margin: 5px; 126 | width: 85%; 127 | border: 2px solid #f6f6f6; 128 | -webkit-transition: all 0.5s ease-in-out; 129 | -moz-transition: all 0.5s ease-in-out; 130 | -ms-transition: all 0.5s ease-in-out; 131 | -o-transition: all 0.5s ease-in-out; 132 | transition: all 0.5s ease-in-out; 133 | -webkit-border-radius: 5px 5px 5px 5px; 134 | border-radius: 5px 5px 5px 5px; 135 | } 136 | 137 | input[type=password] { 138 | background-color: #f6f6f6; 139 | border: none; 140 | color: #0d0d0d; 141 | padding: 15px 32px; 142 | text-align: center; 143 | text-decoration: none; 144 | display: inline-block; 145 | font-size: 16px; 146 | margin: 5px; 147 | width: 85%; 148 | border: 2px solid #f6f6f6; 149 | -webkit-transition: all 0.5s ease-in-out; 150 | -moz-transition: all 0.5s ease-in-out; 151 | -ms-transition: all 0.5s ease-in-out; 152 | -o-transition: all 0.5s ease-in-out; 153 | transition: all 0.5s ease-in-out; 154 | -webkit-border-radius: 5px 5px 5px 5px; 155 | border-radius: 5px 5px 5px 5px; 156 | } 157 | 158 | input[type=text]:focus { 159 | background-color: #fff; 160 | border-bottom: 2px solid #5fbae9; 161 | } 162 | 163 | input[type=text]:placeholder { 164 | color: #cccccc; 165 | } 166 | 167 | 168 | 169 | /* ANIMATIONS */ 170 | 171 | /* Simple CSS3 Fade-in-down Animation */ 172 | .fadeInDown { 173 | -webkit-animation-name: fadeInDown; 174 | animation-name: fadeInDown; 175 | -webkit-animation-duration: 1s; 176 | animation-duration: 1s; 177 | -webkit-animation-fill-mode: both; 178 | animation-fill-mode: both; 179 | } 180 | 181 | @-webkit-keyframes fadeInDown { 182 | 0% { 183 | opacity: 0; 184 | -webkit-transform: translate3d(0, -100%, 0); 185 | transform: translate3d(0, -100%, 0); 186 | } 187 | 100% { 188 | opacity: 1; 189 | -webkit-transform: none; 190 | transform: none; 191 | } 192 | } 193 | 194 | @keyframes fadeInDown { 195 | 0% { 196 | opacity: 0; 197 | -webkit-transform: translate3d(0, -100%, 0); 198 | transform: translate3d(0, -100%, 0); 199 | } 200 | 100% { 201 | opacity: 1; 202 | -webkit-transform: none; 203 | transform: none; 204 | } 205 | } 206 | 207 | /* Simple CSS3 Fade-in Animation */ 208 | @-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 209 | @-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 210 | @keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 211 | 212 | .fadeIn { 213 | opacity:0; 214 | -webkit-animation:fadeIn ease-in 0.5s; 215 | -moz-animation:fadeIn ease-in 0.5s; 216 | animation:fadeIn ease-in 0.5s; 217 | 218 | -webkit-animation-fill-mode:forwards; 219 | -moz-animation-fill-mode:forwards; 220 | animation-fill-mode:forwards; 221 | 222 | -webkit-animation-duration:1s; 223 | -moz-animation-duration:1s; 224 | animation-duration:1s; 225 | } 226 | 227 | .fadeInTitle { 228 | -webkit-animation-delay: 0.5s; 229 | -moz-animation-delay: 0.5s; 230 | animation-delay: 0.5s; 231 | background-color: rgb(0, 0, 0); 232 | } 233 | 234 | .fadeIn.first { 235 | -webkit-animation-delay: 0.5s; 236 | -moz-animation-delay: 0.5s; 237 | animation-delay: 0.5s; 238 | } 239 | 240 | .fadeIn.second { 241 | -webkit-animation-delay: 0.9s; 242 | -moz-animation-delay: 0.9s; 243 | animation-delay: 0.9s; 244 | } 245 | 246 | .fadeIn.third { 247 | -webkit-animation-delay: 1.3s; 248 | -moz-animation-delay: 1.3s; 249 | animation-delay: 1.3s; 250 | } 251 | 252 | 253 | /* Simple CSS3 Fade-in Animation */ 254 | .underlineHover:after { 255 | display: block; 256 | left: 0; 257 | bottom: -10px; 258 | width: 0; 259 | height: 2px; 260 | background-color: #000000; 261 | content: ""; 262 | transition: width 0.2s; 263 | } 264 | 265 | .underlineHover:hover { 266 | color: #0d0d0d; 267 | } 268 | 269 | .underlineHover:hover:after{ 270 | width: 100%; 271 | } 272 | 273 | 274 | 275 | 276 | 277 | -------------------------------------------------------------------------------- /S3Bucket/Public/css/landing.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Poppins", sans-serif; 3 | height: 50vh; 4 | background-color: #000000; 5 | } 6 | 7 | a { 8 | color: #000000; 9 | display: inline-block; 10 | text-decoration: none; 11 | font-weight: 400; 12 | } 13 | 14 | h2 { 15 | text-align: center; 16 | font-size: 16px; 17 | font-weight: 600; 18 | text-transform: uppercase; 19 | display: inline-block; 20 | margin: 40px 8px 10px 8px; 21 | color: #cccccc; 22 | } 23 | 24 | 25 | /* STRUCTURE */ 26 | 27 | .wrapper { 28 | display: flex; 29 | align-items: center; 30 | flex-direction: column; 31 | justify-content: center; 32 | width: 100%; 33 | min-height: 100%; 34 | padding: 20px; 35 | } 36 | 37 | #formContent { 38 | -webkit-border-radius: 10px 10px 10px 10px; 39 | border-radius: 10px 10px 10px 10px; 40 | background: #fff; 41 | width: 100%; 42 | max-width: 6000px; 43 | position: relative; 44 | text-align: center; 45 | } 46 | 47 | #formFooter { 48 | background-color: #f6f6f6; 49 | border-top: 1px solid #dce8f1; 50 | padding: 25px; 51 | text-align: center; 52 | -webkit-border-radius: 0 0 10px 10px; 53 | border-radius: 0 0 10px 10px; 54 | } 55 | 56 | 57 | /* TABS */ 58 | 59 | h2.inactive { 60 | color: #cccccc; 61 | } 62 | 63 | h2.active { 64 | color: #0d0d0d; 65 | border-bottom: 2px solid #5fbae9; 66 | } 67 | 68 | 69 | /* FORM TYPOGRAPHY*/ 70 | 71 | input[type=button], 72 | input[type=submit], 73 | input[type=reset] { 74 | background-color: #000000; 75 | border: none; 76 | color: white; 77 | padding: 15px 80px; 78 | text-align: center; 79 | text-decoration: none; 80 | display: inline-block; 81 | text-transform: uppercase; 82 | font-size: 13px; 83 | -webkit-box-shadow: 0 10px 30px 0 rgba(95, 186, 233, 0.4); 84 | box-shadow: 0 10px 30px 0 rgba(95, 186, 233, 0.4); 85 | -webkit-border-radius: 5px 5px 5px 5px; 86 | border-radius: 5px 5px 5px 5px; 87 | margin: 5px 20px 40px 20px; 88 | -webkit-transition: all 0.3s ease-in-out; 89 | -moz-transition: all 0.3s ease-in-out; 90 | -ms-transition: all 0.3s ease-in-out; 91 | -o-transition: all 0.3s ease-in-out; 92 | transition: all 0.3s ease-in-out; 93 | } 94 | 95 | input[type=button]:hover, 96 | input[type=submit]:hover, 97 | input[type=reset]:hover { 98 | background-color: #000203; 99 | } 100 | 101 | input[type=button]:active, 102 | input[type=submit]:active, 103 | input[type=reset]:active { 104 | -moz-transform: scale(0.95); 105 | -webkit-transform: scale(0.95); 106 | -o-transform: scale(0.95); 107 | -ms-transform: scale(0.95); 108 | transform: scale(0.95); 109 | } 110 | 111 | input[type=text] { 112 | background-color: #f6f6f6; 113 | border: none; 114 | color: #0d0d0d; 115 | padding: 15px 32px; 116 | text-align: center; 117 | text-decoration: none; 118 | display: inline-block; 119 | font-size: 16px; 120 | margin: 5px; 121 | width: 85%; 122 | border: 2px solid #f6f6f6; 123 | -webkit-transition: all 0.5s ease-in-out; 124 | -moz-transition: all 0.5s ease-in-out; 125 | -ms-transition: all 0.5s ease-in-out; 126 | -o-transition: all 0.5s ease-in-out; 127 | transition: all 0.5s ease-in-out; 128 | -webkit-border-radius: 5px 5px 5px 5px; 129 | border-radius: 5px 5px 5px 5px; 130 | } 131 | 132 | input[type=text]:focus { 133 | background-color: #fff; 134 | border-bottom: 2px solid #5fbae9; 135 | } 136 | 137 | input[type=text]:placeholder { 138 | color: #cccccc; 139 | } 140 | 141 | 142 | /* ANIMATIONS */ 143 | 144 | 145 | /* Simple CSS3 Fade-in-down Animation */ 146 | 147 | .fadeInDown { 148 | -webkit-animation-name: fadeInDown; 149 | animation-name: fadeInDown; 150 | -webkit-animation-duration: 1s; 151 | animation-duration: 1s; 152 | -webkit-animation-fill-mode: both; 153 | animation-fill-mode: both; 154 | } 155 | 156 | @-webkit-keyframes fadeInDown { 157 | 0% { 158 | opacity: 0; 159 | -webkit-transform: translate3d(0, -100%, 0); 160 | transform: translate3d(0, -100%, 0); 161 | } 162 | 100% { 163 | opacity: 1; 164 | -webkit-transform: none; 165 | transform: none; 166 | } 167 | } 168 | 169 | @keyframes fadeInDown { 170 | 0% { 171 | opacity: 0; 172 | -webkit-transform: translate3d(0, -100%, 0); 173 | transform: translate3d(0, -100%, 0); 174 | } 175 | 100% { 176 | opacity: 1; 177 | -webkit-transform: none; 178 | transform: none; 179 | } 180 | } 181 | 182 | 183 | /* Simple CSS3 Fade-in Animation */ 184 | 185 | @-webkit-keyframes fadeIn { 186 | from { 187 | opacity: 0; 188 | } 189 | to { 190 | opacity: 1; 191 | } 192 | } 193 | 194 | @-moz-keyframes fadeIn { 195 | from { 196 | opacity: 0; 197 | } 198 | to { 199 | opacity: 1; 200 | } 201 | } 202 | 203 | @keyframes fadeIn { 204 | from { 205 | opacity: 0; 206 | } 207 | to { 208 | opacity: 1; 209 | } 210 | } 211 | 212 | .fadeIn { 213 | opacity: 0; 214 | -webkit-animation: fadeIn ease-in 1; 215 | -moz-animation: fadeIn ease-in 1; 216 | animation: fadeIn ease-in 1; 217 | -webkit-animation-fill-mode: forwards; 218 | -moz-animation-fill-mode: forwards; 219 | animation-fill-mode: forwards; 220 | -webkit-animation-duration: 1s; 221 | -moz-animation-duration: 1s; 222 | animation-duration: 1s; 223 | } 224 | 225 | .fadeIn.first { 226 | -webkit-animation-delay: 0.4s; 227 | -moz-animation-delay: 0.4s; 228 | animation-delay: 0.4s; 229 | } 230 | 231 | .fadeIn.second { 232 | -webkit-animation-delay: 0.6s; 233 | -moz-animation-delay: 0.6s; 234 | animation-delay: 0.6s; 235 | } 236 | 237 | .fadeIn.third { 238 | -webkit-animation-delay: 0.8s; 239 | -moz-animation-delay: 0.8s; 240 | animation-delay: 0.8s; 241 | } 242 | 243 | .fadeIn.fourth { 244 | -webkit-animation-delay: 1s; 245 | -moz-animation-delay: 1s; 246 | animation-delay: 1s; 247 | } 248 | 249 | 250 | /* Simple CSS3 Fade-in Animation */ 251 | 252 | .underlineHover:after { 253 | display: block; 254 | left: 0; 255 | bottom: -10px; 256 | width: 0; 257 | height: 2px; 258 | background-color: #000000; 259 | content: ""; 260 | transition: width 0.2s; 261 | } 262 | 263 | .underlineHover:hover { 264 | color: #0d0d0d; 265 | } 266 | 267 | .underlineHover:hover:after { 268 | width: 100%; 269 | } 270 | 271 | * { 272 | box-sizing: border-box; 273 | } 274 | 275 | .row::after { 276 | content: ""; 277 | clear: both; 278 | display: table; 279 | 280 | } 281 | 282 | .img-container { 283 | float: left; 284 | width: 33.33%; 285 | } 286 | 287 | img { 288 | border-radius: 20%; 289 | } 290 | #previousOrders{ 291 | margin: 150px; 292 | } 293 | 294 | #row{ 295 | right: 50px; 296 | 297 | } 298 | 299 | #bankInfo{ 300 | margin: 5px; 301 | 302 | } 303 | 304 | #password{ 305 | margin: 5px; 306 | } -------------------------------------------------------------------------------- /S3Bucket/Public/css/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Poppins", sans-serif; 3 | height: 90vh; 4 | background-color: #000000; 5 | } 6 | 7 | a { 8 | color: #000000; 9 | display:inline-block; 10 | text-decoration: none; 11 | font-weight: 400; 12 | } 13 | 14 | h2 { 15 | text-align: center; 16 | font-size: 16px; 17 | font-weight: 600; 18 | text-transform: uppercase; 19 | display:inline-block; 20 | margin: 40px 8px 10px 8px; 21 | color: #cccccc; 22 | } 23 | 24 | 25 | 26 | /* STRUCTURE */ 27 | 28 | .wrapper { 29 | display: flex; 30 | align-items: center; 31 | flex-direction: column; 32 | justify-content: center; 33 | width: 100%; 34 | min-height: 100%; 35 | padding: 170px; 36 | } 37 | 38 | #formContent { 39 | -webkit-border-radius: 10px 10px 10px 10px; 40 | border-radius: 10px 10px 10px 10px; 41 | background: #fff; 42 | padding: 30px; 43 | width: 90%; 44 | max-width: 450px; 45 | position: relative; 46 | padding: 0px; 47 | -webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 48 | box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 49 | text-align: center; 50 | } 51 | 52 | #formFooter { 53 | background-color: #f6f6f6; 54 | border-top: 1px solid #dce8f1; 55 | padding: 25px; 56 | text-align: center; 57 | -webkit-border-radius: 0 0 10px 10px; 58 | border-radius: 0 0 10px 10px; 59 | } 60 | 61 | 62 | 63 | /* TABS */ 64 | 65 | h2.inactive { 66 | color: #cccccc; 67 | } 68 | 69 | h2.active { 70 | color: #0d0d0d; 71 | border-bottom: 2px solid #5fbae9; 72 | } 73 | 74 | 75 | 76 | /* FORM TYPOGRAPHY*/ 77 | 78 | input[type=button], input[type=submit], input[type=reset] { 79 | background-color: #000000; 80 | border: none; 81 | color: white; 82 | padding: 15px 80px; 83 | text-align: center; 84 | text-decoration: none; 85 | display: inline-block; 86 | text-transform: uppercase; 87 | font-size: 13px; 88 | -webkit-box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 89 | box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 90 | -webkit-border-radius: 5px 5px 5px 5px; 91 | border-radius: 5px 5px 5px 5px; 92 | margin: 5px 20px 40px 20px; 93 | -webkit-transition: all 0.3s ease-in-out; 94 | -moz-transition: all 0.3s ease-in-out; 95 | -ms-transition: all 0.3s ease-in-out; 96 | -o-transition: all 0.3s ease-in-out; 97 | transition: all 0.3s ease-in-out; 98 | } 99 | 100 | input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { 101 | background-color: #000203; 102 | } 103 | 104 | input[type=button]:active, input[type=submit]:active, input[type=reset]:active { 105 | -moz-transform: scale(0.95); 106 | -webkit-transform: scale(0.95); 107 | -o-transform: scale(0.95); 108 | -ms-transform: scale(0.95); 109 | transform: scale(0.95); 110 | } 111 | 112 | input[type=text] { 113 | background-color: #f6f6f6; 114 | border: none; 115 | color: #0d0d0d; 116 | padding: 15px 32px; 117 | text-align: center; 118 | text-decoration: none; 119 | display: inline-block; 120 | font-size: 16px; 121 | margin: 5px; 122 | width: 85%; 123 | border: 2px solid #f6f6f6; 124 | -webkit-transition: all 0.5s ease-in-out; 125 | -moz-transition: all 0.5s ease-in-out; 126 | -ms-transition: all 0.5s ease-in-out; 127 | -o-transition: all 0.5s ease-in-out; 128 | transition: all 0.5s ease-in-out; 129 | -webkit-border-radius: 5px 5px 5px 5px; 130 | border-radius: 5px 5px 5px 5px; 131 | } 132 | 133 | input[type=text]:focus { 134 | background-color: #fff; 135 | border-bottom: 2px solid #5fbae9; 136 | } 137 | 138 | input[type=text]:placeholder { 139 | color: #cccccc; 140 | } 141 | 142 | 143 | 144 | /* ANIMATIONS */ 145 | 146 | /* Simple CSS3 Fade-in-down Animation */ 147 | .fadeInDown { 148 | -webkit-animation-name: fadeInDown; 149 | animation-name: fadeInDown; 150 | -webkit-animation-duration: 1s; 151 | animation-duration: 1s; 152 | -webkit-animation-fill-mode: both; 153 | animation-fill-mode: both; 154 | } 155 | 156 | @-webkit-keyframes fadeInDown { 157 | 0% { 158 | opacity: 0; 159 | -webkit-transform: translate3d(0, -100%, 0); 160 | transform: translate3d(0, -100%, 0); 161 | } 162 | 100% { 163 | opacity: 1; 164 | -webkit-transform: none; 165 | transform: none; 166 | } 167 | } 168 | 169 | @keyframes fadeInDown { 170 | 0% { 171 | opacity: 0; 172 | -webkit-transform: translate3d(0, -100%, 0); 173 | transform: translate3d(0, -100%, 0); 174 | } 175 | 100% { 176 | opacity: 1; 177 | -webkit-transform: none; 178 | transform: none; 179 | } 180 | } 181 | 182 | /* Simple CSS3 Fade-in Animation */ 183 | @-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 184 | @-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 185 | @keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 186 | 187 | .fadeIn { 188 | opacity:0; 189 | -webkit-animation:fadeIn ease-in 1; 190 | -moz-animation:fadeIn ease-in 1; 191 | animation:fadeIn ease-in 1; 192 | 193 | -webkit-animation-fill-mode:forwards; 194 | -moz-animation-fill-mode:forwards; 195 | animation-fill-mode:forwards; 196 | 197 | -webkit-animation-duration:1s; 198 | -moz-animation-duration:1s; 199 | animation-duration:1s; 200 | } 201 | 202 | .fadeIn.first { 203 | -webkit-animation-delay: 0.4s; 204 | -moz-animation-delay: 0.4s; 205 | animation-delay: 0.4s; 206 | } 207 | 208 | .fadeIn.second { 209 | -webkit-animation-delay: 0.6s; 210 | -moz-animation-delay: 0.6s; 211 | animation-delay: 0.6s; 212 | } 213 | 214 | .fadeIn.third { 215 | -webkit-animation-delay: 0.8s; 216 | -moz-animation-delay: 0.8s; 217 | animation-delay: 0.8s; 218 | } 219 | 220 | .fadeIn.fourth { 221 | -webkit-animation-delay: 1s; 222 | -moz-animation-delay: 1s; 223 | animation-delay: 1s; 224 | } 225 | 226 | /* Simple CSS3 Fade-in Animation */ 227 | .underlineHover:after { 228 | display: block; 229 | left: 0; 230 | bottom: -10px; 231 | width: 0; 232 | height: 2px; 233 | background-color: #000000; 234 | content: ""; 235 | transition: width 0.2s; 236 | } 237 | 238 | .underlineHover:hover { 239 | color: #0d0d0d; 240 | } 241 | 242 | .underlineHover:hover:after{ 243 | width: 100%; 244 | } 245 | -------------------------------------------------------------------------------- /S3Bucket/Public/css/styles.css: -------------------------------------------------------------------------------- 1 | 2 | /* BASIC */ 3 | body { 4 | font-family: "Poppins", sans-serif; 5 | height: 90vh; 6 | background-color: #000000; 7 | } 8 | 9 | a { 10 | color: #000000; 11 | display:inline-block; 12 | text-decoration: none; 13 | font-weight: 400; 14 | } 15 | 16 | h2 { 17 | text-align: center; 18 | font-size: 16px; 19 | font-weight: 600; 20 | text-transform: uppercase; 21 | display:inline-block; 22 | margin: 40px 8px 10px 8px; 23 | color: #cccccc; 24 | } 25 | 26 | 27 | 28 | /* STRUCTURE */ 29 | 30 | .wrapper { 31 | display: flex; 32 | align-items: center; 33 | flex-direction: column; 34 | justify-content: center; 35 | width: 95%; 36 | min-height: 100%; 37 | padding: 20px; 38 | } 39 | 40 | #formContent { 41 | -webkit-border-radius: 10px 10px 10px 10px; 42 | border-radius: 10px 10px 10px 10px; 43 | background: #fff; 44 | padding: 30px; 45 | width: 90%; 46 | max-width: 450px; 47 | position: relative; 48 | padding: 0px; 49 | -webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 50 | box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); 51 | text-align: center; 52 | } 53 | 54 | #formFooter { 55 | background-color: #f6f6f6; 56 | border-top: 1px solid #dce8f1; 57 | padding: 25px; 58 | text-align: center; 59 | -webkit-border-radius: 0 0 10px 10px; 60 | border-radius: 0 0 10px 10px; 61 | } 62 | 63 | 64 | 65 | /* TABS */ 66 | 67 | h2.inactive { 68 | color: #cccccc; 69 | } 70 | 71 | h2.active { 72 | color: #0d0d0d; 73 | border-bottom: 2px solid #5fbae9; 74 | } 75 | 76 | 77 | 78 | /* FORM TYPOGRAPHY*/ 79 | 80 | input[type=button], input[type=submit], input[type=reset] { 81 | background-color: #000000; 82 | border: none; 83 | color: white; 84 | padding: 15px 80px; 85 | text-align: center; 86 | text-decoration: none; 87 | display: inline-block; 88 | text-transform: uppercase; 89 | font-size: 13px; 90 | -webkit-box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 91 | box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); 92 | -webkit-border-radius: 5px 5px 5px 5px; 93 | border-radius: 5px 5px 5px 5px; 94 | margin: 5px 20px 40px 20px; 95 | -webkit-transition: all 0.3s ease-in-out; 96 | -moz-transition: all 0.3s ease-in-out; 97 | -ms-transition: all 0.3s ease-in-out; 98 | -o-transition: all 0.3s ease-in-out; 99 | transition: all 0.3s ease-in-out; 100 | } 101 | 102 | input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { 103 | background-color: #000203; 104 | } 105 | 106 | input[type=button]:active, input[type=submit]:active, input[type=reset]:active { 107 | -moz-transform: scale(0.95); 108 | -webkit-transform: scale(0.95); 109 | -o-transform: scale(0.95); 110 | -ms-transform: scale(0.95); 111 | transform: scale(0.95); 112 | } 113 | 114 | input[type=text] { 115 | background-color: #f6f6f6; 116 | border: none; 117 | color: #0d0d0d; 118 | padding: 15px 32px; 119 | text-align: center; 120 | text-decoration: none; 121 | display: inline-block; 122 | font-size: 16px; 123 | margin: 5px; 124 | width: 85%; 125 | border: 2px solid #f6f6f6; 126 | -webkit-transition: all 0.5s ease-in-out; 127 | -moz-transition: all 0.5s ease-in-out; 128 | -ms-transition: all 0.5s ease-in-out; 129 | -o-transition: all 0.5s ease-in-out; 130 | transition: all 0.5s ease-in-out; 131 | -webkit-border-radius: 5px 5px 5px 5px; 132 | border-radius: 5px 5px 5px 5px; 133 | } 134 | 135 | input[type=text]:focus { 136 | background-color: #fff; 137 | border-bottom: 2px solid #5fbae9; 138 | } 139 | 140 | input[type=text]:placeholder { 141 | color: #cccccc; 142 | } 143 | 144 | 145 | 146 | /* ANIMATIONS */ 147 | 148 | /* Simple CSS3 Fade-in-down Animation */ 149 | .fadeInDown { 150 | -webkit-animation-name: fadeInDown; 151 | animation-name: fadeInDown; 152 | -webkit-animation-duration: 1s; 153 | animation-duration: 1s; 154 | -webkit-animation-fill-mode: both; 155 | animation-fill-mode: both; 156 | } 157 | 158 | @-webkit-keyframes fadeInDown { 159 | 0% { 160 | opacity: 0; 161 | -webkit-transform: translate3d(0, -100%, 0); 162 | transform: translate3d(0, -100%, 0); 163 | } 164 | 100% { 165 | opacity: 1; 166 | -webkit-transform: none; 167 | transform: none; 168 | } 169 | } 170 | 171 | @keyframes fadeInDown { 172 | 0% { 173 | opacity: 0; 174 | -webkit-transform: translate3d(0, -100%, 0); 175 | transform: translate3d(0, -100%, 0); 176 | } 177 | 100% { 178 | opacity: 1; 179 | -webkit-transform: none; 180 | transform: none; 181 | } 182 | } 183 | 184 | /* Simple CSS3 Fade-in Animation */ 185 | @-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 186 | @-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 187 | @keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 188 | 189 | .fadeIn { 190 | opacity:0; 191 | -webkit-animation:fadeIn ease-in 1; 192 | -moz-animation:fadeIn ease-in 1; 193 | animation:fadeIn ease-in 1; 194 | 195 | -webkit-animation-fill-mode:forwards; 196 | -moz-animation-fill-mode:forwards; 197 | animation-fill-mode:forwards; 198 | 199 | -webkit-animation-duration:1s; 200 | -moz-animation-duration:1s; 201 | animation-duration:1s; 202 | } 203 | 204 | .fadeIn.first { 205 | -webkit-animation-delay: 0.4s; 206 | -moz-animation-delay: 0.4s; 207 | animation-delay: 0.4s; 208 | } 209 | 210 | .fadeIn.second { 211 | -webkit-animation-delay: 0.6s; 212 | -moz-animation-delay: 0.6s; 213 | animation-delay: 0.6s; 214 | } 215 | 216 | .fadeIn.third { 217 | -webkit-animation-delay: 0.8s; 218 | -moz-animation-delay: 0.8s; 219 | animation-delay: 0.8s; 220 | } 221 | 222 | .fadeIn.fourth { 223 | -webkit-animation-delay: 1s; 224 | -moz-animation-delay: 1s; 225 | animation-delay: 1s; 226 | } 227 | 228 | /* Simple CSS3 Fade-in Animation */ 229 | .underlineHover:after { 230 | display: block; 231 | left: 0; 232 | bottom: -10px; 233 | width: 0; 234 | height: 2px; 235 | background-color: #000000; 236 | content: ""; 237 | transition: width 0.2s; 238 | } 239 | 240 | .underlineHover:hover { 241 | color: #0d0d0d; 242 | } 243 | 244 | .underlineHover:hover:after{ 245 | width: 100%; 246 | } 247 | 248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /S3Bucket/Public/images/photo-1494548162494-384bba4ab999.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/S3Bucket/Public/images/photo-1494548162494-384bba4ab999.jfif -------------------------------------------------------------------------------- /S3Bucket/Public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Landing Page 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 40 | 41 |
42 |
43 | 44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /S3Bucket/Public/video/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/S3Bucket/Public/video/video.mp4 -------------------------------------------------------------------------------- /Simplified-Zero-Knowledge-Proof-Identity-Verification.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | import random 5 | import math 6 | import os 7 | import struct 8 | ''' 9 | Author: ジョシュアモル 10 | Date: July, 15, 2020 11 | Contact: devr4ndom@gmail.com 12 | Version: 2.6 13 | ''' 14 | 15 | ''' 16 | FUNCTIONS: 17 | ''' 18 | 19 | def is_Prime(prime): 20 | if (prime > 0 and prime < 4): 21 | return prime 22 | if (prime % 2 == 0): 23 | return 0 24 | i = 3 25 | #This while loop check if a number is prime, it is only required that you check sqrt(prime) to determine if it is prime. 26 | while (prime % i != 0 and i < math.ceil(math.sqrt(prime))): 27 | i += 2 28 | #A print out to show that the promgram didn't freeze (This is an entensive process) 29 | #if i % 50001 == 0: 30 | #print("i == %d / %d\n%f%% Done....." % (i, math.ceil(math.sqrt(prime)), i / math.ceil(math.sqrt(prime)) * 100)) 31 | if (prime % i != 0): 32 | return prime 33 | return 0 34 | 35 | def gen_Alpha_Q(min, p): 36 | #alphaList = [] 37 | #pm1 = p minus 1 38 | pm1 = p - 1 39 | temp = pm1 40 | # Setting temp to be the and half of p - 1 41 | temp = temp / 2 42 | #Ensuring temp is an odd number 43 | if (temp % 2 == 0): 44 | temp += 1 45 | #This for statement is looping through posssiable q values until it finds the highest q value possiable. 46 | #It also skips even numbers to improve the time complexity. 47 | for q in range(int(temp), min, -2): 48 | if (pm1 % q == 0): 49 | #print("Q: %d Has been found to be a divisor of P: %d - 1\nDetermining Primality of Q" % (q, p)) 50 | if (is_Prime(q) > 0): 51 | 52 | #Finding Alpha Value 53 | print("\nDetermining: (Alpha)。。0_0\nThis Should? Be Quicker シ\n\n\n\n") 54 | for alpha in range(pm1, 2, -1): 55 | #This if statement speeds up the program dermaticly as it determines if alpha is 56 | #vaild before checking all O(N) possibilities to determine minimum period シ 57 | if(pow(alpha, q, p) == 1): 58 | #This for statment checks if alpha's minimum period is alpha^q 59 | for x in range(2, int(p)): 60 | calc = pow(alpha, x, p) 61 | if (calc == 1 and x == q): 62 | #print("*********\nP: %d\nQ: %d\nAlpha: %d\n*********" % (p, q, alpha)) 63 | #alphaList.append(alpha) 64 | return alpha, q 65 | #print("# Alpha's: %d\nAlphaList Contents: %s" % (len(alphaList), alphaList)) 66 | return 0, 0 67 | 68 | def get_Random_Prime(min, max): 69 | prime = 0 70 | # loops until a proper prime number is returned from is_Prime 71 | while prime == 0: 72 | prime = gen_Secure_Random(min, max) 73 | prime = is_Prime(prime) 74 | return prime 75 | 76 | def gen_Secure_Random(min, max): 77 | systemRandom = random.SystemRandom() 78 | return systemRandom.randint(min, max) 79 | 80 | #Computes the public key sent to the verifier 81 | def compute_Public_Key(alpha, priv_Key, p, q): 82 | return pow(alpha, q - priv_Key, p) 83 | 84 | #Computes the commitment sent to the verifier 85 | def compute_Public_Commitment(alpha, offset, p): 86 | return pow(alpha, offset, p) 87 | 88 | #Computes the response to the random number challege the verifier sent then sends the output back to the verifier. 89 | def compute_Challenge_Response(offset, priv_Key, challenge, q): 90 | return offset + priv_Key * challenge % q 91 | 92 | #The verifier computes if the commitment and the response to get a value that the verifier will then compare for verification. 93 | def compute_Identification_Verification(alpha, response, public_Key, challenge): 94 | return pow(alpha, response, p) * pow(public_Key, challenge, p) % p 95 | 96 | ''' 97 | START OF PROGRAM: 98 | ''' 99 | 100 | #These complexity targets will determine the programs difficultly ALL variables generated. 101 | #Ensure a wide range as well sufficently large powers of 2. 102 | min_P_PrimeComplexity = pow(2,25) 103 | max_P_PrimeComplexity = pow(2,26) 104 | 105 | #Having some fun with things 106 | print("***********\nDetermining: (P, Q)。。0_0\nPLEASE BE PATIENT。。。\n***********") 107 | 108 | #p = 15604671989 109 | #Finds init prime value used as the seed for all future number generations. 110 | p = get_Random_Prime(min_P_PrimeComplexity, max_P_PrimeComplexity) 111 | 112 | #Generates q such that q is the largest prime divisor of p-1. 113 | #Generates alpha such that alpha^q mod p = 1 with q being the period. 114 | #Time enhancements have been added to code to reduce execution time. 115 | alpha, q = gen_Alpha_Q(1, p) 116 | 117 | #Key Pair 118 | #priv_Key = gen_Secure_Random(1, q - 1) 119 | priv_Key = 1234 120 | public_Key = compute_Public_Key(alpha, priv_Key, p, q) 121 | 122 | #Random number to offset caluclates with, helps with keeping your secret... secret シ 123 | offset = gen_Secure_Random(1, q - 1) 124 | 125 | #The provers Idendity Commitment to the verifier. 126 | commitment = compute_Public_Commitment(alpha, offset, p) 127 | 128 | #How large will the challenge to the Prover be? 129 | # 1 / 2^difficulty is the probability the a malicous prover will deceive the Verifier. 130 | # ******* 2^80 has the deception probaility of 0.0000000000000000000000008271806125530276748......********* 131 | difficulty = gen_Secure_Random(1, int(math.log(q, 2) + 1)) 132 | 133 | #Challenge to the prover to verifiy they have the key they claim. 134 | challenge = gen_Secure_Random(1, difficulty) 135 | 136 | #This is the response from the prover given the challenge 137 | response = compute_Challenge_Response(offset, priv_Key, challenge, q) 138 | 139 | #This is the verification of the response given the commitment. 140 | verification = compute_Identification_Verification(alpha, response, public_Key, challenge) 141 | 142 | if (commitment == compute_Identification_Verification(alpha, response, public_Key, challenge)): 143 | print("***********\nVERIFIED!!!!\n\nCommitment: %d\tChallenge Response: %d\n***********" % (commitment, verification)) 144 | else: 145 | print("Authentication ERROR") -------------------------------------------------------------------------------- /Zero-Knowledge-Proofs-Security.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Zero-Knowledge-Proofs-Security.pdf -------------------------------------------------------------------------------- /Zero-Knowledge-Proofs-Security.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3vRandom/Zero-Knowledge-Proof-Identity-Verification/b74649f81be34310eafcc2c94759232ede0b67da/Zero-Knowledge-Proofs-Security.pptx -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | astroid==2.4.2 2 | boto==2.49.0 3 | boto3==1.14.23 4 | botocore==1.17.23 5 | certifi==2020.6.20 6 | cffi==1.14.0 7 | chardet==3.0.4 8 | click==7.1.2 9 | comtypes==1.1.7 10 | cryptography==2.9.2 11 | docutils==0.15.2 12 | ecdsa==0.15 13 | Flask==1.1.2 14 | Flask-Cors==3.0.8 15 | idna==2.10 16 | isort==4.3.21 17 | itsdangerous==1.1.0 18 | Jinja2==2.11.2 19 | jmespath==0.10.0 20 | jwcrypto==0.7 21 | lazy-object-proxy==1.4.3 22 | MarkupSafe==1.1.1 23 | mccabe==0.6.1 24 | numpy==1.19.0 25 | pandas==1.0.5 26 | pyasn1==0.4.8 27 | pycparser==2.20 28 | pyeviews==1.0.1 29 | PyJWT==1.7.1 30 | pylint==2.5.3 31 | PyMySQL==0.9.3 32 | python-dateutil==2.8.1 33 | python-jose==3.1.0 34 | pytz==2020.1 35 | requests==2.24.0 36 | rsa==4.6 37 | s3transfer==0.3.3 38 | six==1.15.0 39 | toml==0.10.1 40 | typed-ast==1.4.1 41 | urllib3==1.25.9 42 | Werkzeug==1.0.1 43 | wrapt==1.12.1 --------------------------------------------------------------------------------