File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1-
21from pqcrypto .kem .kyber512 import generate_keypair , encrypt , decrypt
3-
4- def encrypt_model (model_weights ):
2+ from types import unionB
3+ def encrypt_model (model_data : union ) -> union
4+ """Encrypt a machine learning model using Post-Quantum Cryptography."""
55 public_key , secret_key = generate_keypair ()
6- ciphertext , shared_secret = encrypt (public_key , model_weights )
6+ ciphertext , _ = encrypt (public_key , str ( model_data ) )
77 return ciphertext , secret_key
88
9- def decrypt_model (ciphertext , secret_key ):
10- model_weights = decrypt (secret_key , ciphertext )
11- return model_weights
9+ def decrypt_model (ciphertext : union , secret_key : union ) -> union :
10+ """Decrypt a machine model using post-quantum cryptography."""
11+ model_data = decrypt (secret_key , ciphertext )
12+ return model_data
You can’t perform that action at this time.
0 commit comments