Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 27744200CCC for ; Fri, 21 Jul 2017 15:32:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2648516BF58; Fri, 21 Jul 2017 13:32:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 75AA716BF4A for ; Fri, 21 Jul 2017 15:32:03 +0200 (CEST) Received: (qmail 3043 invoked by uid 500); 21 Jul 2017 13:32:02 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 3028 invoked by uid 99); 21 Jul 2017 13:32:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2017 13:32:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 31887C0143 for ; Fri, 21 Jul 2017 13:32:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 8adN9oQ0Dsf5 for ; Fri, 21 Jul 2017 13:32:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EC4D75FD38 for ; Fri, 21 Jul 2017 13:32:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7D78DE0D4A for ; Fri, 21 Jul 2017 13:32:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3D06921EE5 for ; Fri, 21 Jul 2017 13:32:00 +0000 (UTC) Date: Fri, 21 Jul 2017 13:32:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5634) Add Crypto and Hash Functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 21 Jul 2017 13:32:04 -0000 [ https://issues.apache.org/jira/browse/DRILL-5634?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1609= 6252#comment-16096252 ]=20 ASF GitHub Bot commented on DRILL-5634: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/drill/pull/865 > Add Crypto and Hash Functions > ----------------------------- > > Key: DRILL-5634 > URL: https://issues.apache.org/jira/browse/DRILL-5634 > Project: Apache Drill > Issue Type: New Feature > Components: Functions - Drill > Affects Versions: 1.10.0 > Reporter: Charles Givre > Labels: doc-impacting, ready-to-commit > Fix For: 1.11.0 > > > This library contains a collection of cryptography-related functions for = Apache Drill. It generally mirrors the crypto functions in MySQL. The pack= age includes: > * **`aes_encrypt()`/ `aes_decrypt()`**: implement encryption and decrypti= on of data using the official AES (Advanced Encryption Standard) algorithm,= previously known as =E2=80=9CRijndael.=E2=80=9D > `AES_ENCRYPT()` encrypts the string `str` using the key string `key_str`= and returns a binary string containing the encrypted output. `AES_DECRYPT(= )` decrypts the encrypted string `crypt_str` using the key string `key_str`= and returns the original cleartext string. If either function argument is = NULL, the function returns NULL. > ```sql > > SELECT aes_encrypt( 'encrypted_text', 'my_secret_key' ) AS aes FROM (VA= LUES(1)); > +---------------------------+ > | aes | > +---------------------------+ > | JkcBUNAn8ByKWCcVmNrKMA=3D=3D | > +---------------------------+ > > SELECT aes_encrypt( 'encrypted_text', 'my_secret_key' ) AS encrypted, > aes_decrypt(aes_encrypt( 'encrypted_text', 'my_secret_key' ),'my_secret_= key') AS decrypted=20 > FROM (VALUES(1)); > +---------------------------+-----------------+ > | encrypted | decrypted | > +---------------------------+-----------------+ > | JkcBUNAn8ByKWCcVmNrKMA=3D=3D | encrypted_text | > +---------------------------+-----------------+ > ``` > * **`md5()`**: Returns the md5 hash of the text. (https://en.wikip= edia.org/wiki/MD5) > Usage: > ```sql > > select md5( 'testing' ) from (VALUES(1)); > +-----------------------------------+ > | EXPR$0 | > +-----------------------------------+ > | ae2b1fca515949e5d54fb22b8ed95575 | > +-----------------------------------+ > ``` > * **`sha(`) / `sha1()`**: Calculates an SHA-1 160-bit checksu= m for the string, as described in RFC 3174 (Secure Hash Algorithm). (https:= //en.wikipedia.org/wiki/SHA-1) The value is returned as a string of 40 hex= adecimal digits, or NULL if the argument was NULL. Note that `sha()` and `s= ha1()` are aliases for the same function.=20 > ```sql > > select sha1( 'testing' ) from (VALUES(1)); > +-------------------------------------------+ > | EXPR$0 | > +-------------------------------------------+ > | dc724af18fbdd4e59189f5fe768a5f8311527050 | > +-------------------------------------------+ > ``` > * **`sha2(`) / `sha256()`**: Calculates an SHA-2 256-bit chec= ksum for the string. (https://en.wikipedia.org/wiki/SHA-2) The value is re= turned as a string of hexadecimal digits, or NULL if the argument was NULL.= Note that `sha2()` and `sha256()` are aliases for the same function.=20 > ```sql > > select sha2( 'testing' ) from (VALUES(1)); > +-------------------------------------------------------------------+ > | EXPR$0 | > +-------------------------------------------------------------------+ > | cf80cd8aed482d5d1527d7dc72fceff84e6326592848447d2dc0b0e87dfc9a90 | > +-------------------------------------------------------------------+ > ``` > Additionally, there are also `sha384()` and `sha512()` functi= ons which return SHA-2 hashes with 384 and 512 bit checksums. -- This message was sent by Atlassian JIRA (v6.4.14#64029)