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
      encrypted_session_key_text = self._rsa_encrypt_data_to_base64(
          self.recipient_key, session_key
      )
  
      return encrypted_session_key_text, encrypted_data_text
  
imports: from Crypto.PublicKey import RSA
  from Crypto.Cipher import PKCS1_OAEP
  from Crypto.Hash import SHA256
  import nacl.secret
  import nacl.utils
  from nacl.signing import SigningKey, VerifyKey
  import base64
  import json
  from sshpubkeys import SSHKey
  from studio.ed25519_key_util import Ed25519KeyUtil
  from studio.payload_builders.payload_builder import PayloadBuilder
  from studio.util import logs
  from studio.payload_builders.unencrypted_payload_builder import UnencryptedPayloadBuilder
  from studio.util.util import check_for_kb_interrupt
label_desc: Use image node_id 7 for calling the EncryptedPayloadBuilder obj's underlying member method code with example usage: obj._encrypt_str(workload) and returns: encrypted_session_key_text,  encrypted_data_text