usencrypt.is_encrypted#

usencrypt.is_encrypted(x, dtype=None, check_collection=True, **kwargs)#

Checks if an object or collection is already encrypted with the USEncrypt® library.

Parameters
  • x (any supported encryptable type) – Any object or collection.

  • dtype (dtype) – A specific subclass of usencrypt.cipher.Ciphertext to check for. Defaults to None.

  • check_collection (bool) – Whether or not to check an iterable object recursively. If False, when x is any type of collection, False is returned. Defaults to True.

Returns

True if x is encrypted; otherwise, False.

Return type

usencrypt.cipher.Boolean

Examples
>>> import usencrypt as ue
>>> a = ue.encrypt(0.756)
>>> b = ue.is_encrypted(a)
>>> ue.decrypt(b)
True