class_docstr: Implementation for experiment payload builder
  using public key RSA encryption.
class_docstr_tok: ["Implementation","for","experiment","payload","builder","using","public","key","RSA","encryption","."]
code: def _encrypt_str(self, workload: str):
      # Generate one-time symmetric session key:
      session_key = nacl.utils.random(32)
  
      # Encrypt the data with the NaCL session key
      data_to_encrypt = workload.encode("utf-8")
      box_out = nacl.secret.SecretBox(session_key)
      encrypted_data = box_out.encrypt(data_to_encrypt)
      encrypted_data_text = base64.b64encode(encrypted_data)
  
      # Encrypt the session key with the public RSA key
      cipher_rsa = PKCS1_OAEP.new(self.recipient_key)
      encrypted_session_key = cipher_rsa.encrypt(session_key)
      encrypted_session_key_text = base64.b64encode(
          encrypted_session_key
      )
  
      return encrypted_session_key_text, encrypted_data_text
  
file_path: studio/studio/completion_service/encryptor.py
imports: import sys
  from Crypto.PublicKey import RSA
  from Crypto.Cipher import PKCS1_OAEP
  import nacl.secret
  import nacl.utils
  import base64
label_desc: Use image node_id 3 for calling the Encryptor obj's underlying member method code with example usage: obj._encrypt_str(workload) and returns: encrypted_session_key_text,  encrypted_data_text