Name
encrypt — Encrypt content in base64 encoding
Synopsis
varchar
encrypt
(
|
in string_session any , |
in
key_name
varchar
) ; |
Description
Returns encrypted content in base64 encoding. The algorithm to encrypt depends of the key, so if the key is AES the AES will be used, if it is 3DES it is 3DES etc. The AES key can be created with xenc_key_AES_rand_create (key_name, 256). Alternatively 3DES key can be generated with xenc_key_3DES_rand_create ().
Parameters
string_session
A content to be encrypted.
key_name
The key name keeping secret.
Return Types
On success the function will return encrypted content in base64 encoding.
Examples
Example 24.459. Simple Use
-- The 'ses' is a function which print the string into a string session: xenc_key_AES_rand_create ('kaes', 256). decrypt (encrypt (ses ('data to encrypt'), 'kaes'), 'kaes');