A python oriented public key encryption algorithm for multi-purpose data structures.
SQLcrypt was originally developed for SQL specific database systems, but later took on the role of a universal encryption mechanism. SQLCrypt allows protection of the confidentiality and integrity of a message, by public key encryption, encrypting the message using the public key, which can only be decrypted using the private key. This is perfect when dealing with classified user information on data systems(I.E: Django web servers and websites).
Concept of usage:
@ SQL Databases:
Importing the SQLCrypt module into your program can be achieved with a one liner as follows.
Once you have imported SQLCrypt you will have full access to all of the libraries functions and classes. For example, if you wanted to encrypt the string "Test" you would use the following code:
Notice that i did not include a "private key" argument in the function call of "Crypt()" above. This means that the module will automatically generate a random "private key" for me and in turn will return the encrypted string along with the generated "private key" in a tuple (string, key).
You can specify a "private key" as follows:
Well how do we decode it?
Good question. In order to decrypt our string we need to first declare a tuple containing our (encrypted_string and our key)(string, key) as follows:
``` from SQLCrypt import * __instance = __Crypt("Test") encoded = __instance.encrypt(500) #500 is my private key. Notice that it is an integer. print encoded #We know that 500 is our private key, hence we can decode it.
decoded = __Crypt.decrypt(encoded, encoded) print decoded ```
Sometimes however you do not have access to the original object containing our tuple object of (string, key), hence we have to specify the arguments ourselves.
File listTips: You can preview the content of files by clicking file names^_^
- Page 1
- Total 1