[ https://issues.apache.org/jira/browse/TRAFODION-3293?focusedWorklogId=224209&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-224209 ]
ASF GitHub Bot logged work on TRAFODION-3293: --------------------------------------------- Author: ASF GitHub Bot Created on: 08/Apr/19 06:39 Start Date: 08/Apr/19 06:39 Worklog Time Spent: 10m Work Description: liuyu000 commented on pull request #1825: [TRAFODION-3293] Add the AES_ENCRYPT Function in the Trafodion SQL Reference Manual URL: https://github.com/apache/trafodion/pull/1825#discussion_r272875633 ########## File path: docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ########## @@ -487,6 +487,141 @@ LARGEINT if the precision of the argument is greater than or equal to ABS (-20 + 12) ``` +<<< +[[aes_encrypt_function]] +== AES_ENCRYPT Function + +The AES_ENCRYPT function encrypts a `_string_` using a specified encryption `_key_` with the AES (Advanced Encryption Standard) algorithm and returns a binary string. + +This function prevents sensitive data from being visible to the public. For example, use the AES_ENCRYPT function to encrypt person identity number to preserve user confidentiality. + +`AES_ENCRYPT (_string_, _key_)` + +[[syntax_description_of_aes_encrypt]] +=== Syntax Description of AES_ENCRYPT + +* `_string_` ++ +is the data to be encrypted. + +* `_key_` ++ +is the encryption key to encrypt the `_string_`. Review comment: Thanks Roberta, I've incorporated your comments. SHA (SHA1), SHA2 and MD5 can be specified, I've added the following contents, any thoughts? This `key` can be hashed using a cryptographic hash function, such as SHA, SHA2 and MD5. - This example demonstrates how the AES_ENCRYPT function works with the SHA function. ``` SELECT AES_ENCRYPT ('hello',SHA ('world')) FROM DUAL; (EXPR) ---------------- [}âXéò0Êw«æÝAÆc --- 1 row(s) selected. ``` - This example demonstrates how the AES_ENCRYPT function works with the SHA2 function. ``` SELECT AES_ENCRYPT ('hello',SHA2 ('world',512)) FROM DUAL; (EXPR) ---------------- ¤÷èx¼ó=L*Ì-µO*A --- 1 row(s) selected. ``` - This example demonstrates how the AES_ENCRYPT function works with the MD5 function. ``` SELECT AES_ENCRYPT ('hello',MD5 ('world')) FROM DUAL; (EXPR) ---------------- C¡ïcåsí[1Ø --- 1 row(s) selected. ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 224209) Time Spent: 3.5h (was: 3h 20m) > Add the AES_ENCRYPT Function in the Trafodion SQL Reference Manual > ------------------------------------------------------------------ > > Key: TRAFODION-3293 > URL: https://issues.apache.org/jira/browse/TRAFODION-3293 > Project: Apache Trafodion > Issue Type: Documentation > Reporter: Liu Yu > Priority: Major > Fix For: 2.4 > > Attachments: image-2019-04-05-19-57-51-005.png > > Time Spent: 3.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)