text: from cryptography.hazmat.primitives import hashes
  from cryptography.hazmat.primitives.asymmetric import padding, rsa
  from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey
  
  
  def generate_keys() -> (RSAPrivateKey, RSAPublicKey):
      private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
      public_key = private_key.public_key()
      return private_key, public_key
  
  
  def sign(message, private):
      try:
          return private.sign(
              message,
              padding.PSS(
                  mgf=padding.MGF1(hashes.SHA256()),
                  salt_length=padding.PSS.MAX_LENGTH
              ),
              hashes.SHA256()
          )
      except:
          return False
  
  
  def verify(message, signature, public: RSAPublicKey):
      try:
          public.verify(
              signature,
              message,
              padding.PSS(
                  mgf=padding.MGF1(hashes.SHA256()),
                  salt_length=padding.PSS.MAX_LENGTH
              ),
              hashes.SHA256()
          )
          return True
      except:
          return False
  