code: def decrypt(ciphertext, keyPath):
      
      with open(keyPath, 'rb') as f:
          key = f.read()
      if len(key) != SecretBox.KEY_SIZE:
          raise ValueError("Key is %d bytes, but must be exactly %d bytes" % (len(key),
                                                                              SecretBox.KEY_SIZE))
      sb = SecretBox(key)
      # The nonce is kept with the message.
      return sb.decrypt(ciphertext)
docs: Decrypts a given message that was encrypted with the encrypt() method.
  
      :param ciphertext: The encrypted message (as a string).
      :param keyPath: A path to a file containing a 256-bit key (and nothing else).
      :type ciphertext: bytes
      :type keyPath: str
      :rtype: bytes
  
      Raises an error if ciphertext was modified
      >>> import tempfile
      >>> k = tempfile.mktemp()
      >>> with open(k, 'wb') as f:
      ...     _ = f.write(nacl.utils.random(SecretBox.KEY_SIZE))
      >>> ciphertext = encrypt("testMessage".encode('utf-8'), k)
      >>> ciphertext = b'5' + ciphertext[1:]
      >>> decrypt(ciphertext, k) # doctest: +IGNORE_EXCEPTION_DETAIL
      Traceback (most recent call last):
      ...
      CryptoError: Decryption failed. Ciphertext failed verification
  
      Otherwise works correctly
      >>> decrypt(encrypt("testMessage".encode('utf-8'), k), k).decode('utf-8') in (u'testMessage', b'testMessage', 'testMessage') # doctest: +ALLOW_UNICODE
      True
  
      >>> import os
      >>> os.remove(k)