9. Crypto Class

Warning

Crypto Class is not thread-safe. Please only have one instance of the class per database. For a thread-safe solution, please use Krptn’s proper User Authentication.

Here is a simple usage example:

 1from krypton.basic import Crypto
 2
 3cryptoObject = Crypto()
 4id = cryptoObject.secureCreate("data", "pwd") # returns an integer
 5print("Reading data:")
 6print(cryptoObject.secureRead(id, "pwd")) # Prints data
 7
 8print("Updating data:")
 9cryptoObject.secureUpdate(id, "New Data", "pwd")
10print(cryptoObject.secureRead(id, "pwd")) # Prints New Data
11
12print("Deleting:")
13cryptoObject.secureDelete(id, "pwd")