usencrypt.encrypt#

usencrypt.encrypt(x, *args, **kwargs)#

Encrypts \(x\) using USEncryption’s encrypted operator computing (EOC) method and stores it in an encrypted object \(E(x)\).

Parameters

x (any supported encryptable type) – The value to be encrypted.

Returns

The encrypted version of x.

Return type

The corresponding subclass of usencrypt.cipher.Ciphertext.

Note

  • All non-boolean numbers are treated as fixed-point to avoid difficulty converting from encrypted integers later.

  • Is marked for singledispatch in case a user wishes to extend it.

Examples
>>> import usencrypt as ue
>>> a = 0.875
>>> ue_a = ue.encrypt(a)
>>> ue_a
(0x7f137bc41f70) Float: 0xcc5546ef1c24962e9f4378fbfcfccaa342015c95cfa79abe86a37e1eada7439a