Using the Overloaded Python Operators#

The main building block for computation using the Encrypted Operator Computation (EOC) method is the overloading of Python functions. In other words, USEncrypt® functions are used to overload the traditional Python syntax when operating on encrypted objects.

For example, adding two encrypted values can be easily done as follows:

>> import usencrypt as ue
>>> x = ue.encrypt(5)
>>> y = ue.encrypt(10)
>>> z = x + y
>>> ue.decrypt(z)
15

The following is a comprehensive list of overloaded operators in USEncrypt®:

Operation

Symbol

Use

Addition

+

x + y

Subtraction

-

x - y

Multiplication

*

x * y

Division

/

x / y

Negation

-

-x

Equal To

==

x == y

Not Equal To

!=

x != y

Greater Than

>

x > y

Less Than

<

x < y

Greater Than or Equal To

>=

x >= y

Less Than or Equal To

<=

x <= y

AND

&

x & y

OR

|

x | y

XOR

^

x ^ y