def test_encryption(card_public_key, door_public_key, card_loop_size, door_loop_size, encryption_key): card_loop_size1 = Encryption.calc_loop_size(card_public_key) door_loop_size1 = Encryption.calc_loop_size(door_public_key) assert (card_loop_size == card_loop_size1) assert (door_loop_size == door_loop_size1) private_key = Encryption.calc_private_key(door_public_key, card_loop_size1) assert (private_key == encryption_key) assert (encryption_key == Encryption.calc_private_key( card_public_key, door_loop_size1))
from Encryption import Encryption card_public_key = 10441485 door_public_key = 1004920 door_loop_size = Encryption.calc_loop_size(door_public_key) encryption_key = Encryption.calc_private_key(card_public_key,door_loop_size) print(f'Encryption Key from card: {encryption_key}')