-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.py
More file actions
29 lines (20 loc) · 818 Bytes
/
verify.py
File metadata and controls
29 lines (20 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json
from final import hash_to_128_bits,hash_to_prime
file_path = 'C:/Users/Aksha/rsa/witness.json'
file_path_1 = 'C:/Users/Aksha/rsa/hashes.json'
with open(file_path, 'r') as file:
witness_data = json.load(file)
with open(file_path_1, 'r') as file:
hash_data = json.load(file)
def number_to_padded_hex(number):
hex_str = hex(number)[2:]
padded_hex_str = hex_str.zfill(64)
return '0x' + padded_hex_str
def get_value(pair_key):
witness = witness_data.get(pair_key, "Key not found") , hash_to_prime(pair_key)
exponent = hash_data.get(pair_key, "Key not found") , hash_to_prime(pair_key)
return witness ,exponent
input = input("Enter a string: ")
witness , exponent = get_value(input)
print("witness",hex(witness[0]))
print("exponent",number_to_padded_hex(exponent[0]))