Examples of Direct UDFs Calls
Note
The user running a command line UDF must be mapped to the owner of the key (passed as a parameter) in the UDF.
Direct Call to ing_e_chr_nm420 for Standard Encryption
SELECT dbo.ing_e_chr_nm420('yourCharValue', /* inputData */'yourDatabase', /* DBName */'dbo', /* DBOwnerName */'yourTable', /* tableName */'yourColumn', /* columnName */0x24A40F6DFB05F379630AC0533E7F6357) /* iv */
AS ENCRYPTED_VALUE
---------------------------------
ENCRYPTED_VALUE
0x9F71F06D9F1E123B68D910F0EC34E8C5
Direct Call to ing_d_chr_nm420 for Standard Encryption
SELECT dbo.ing_d_chr_nm420(0x9F71F06D9F1E123B68D910F0EC34E8C5, /* inputData */'yourDatabase', /* DBName */'dbo', /* DBOwnerName */
'yourTable', /* tableName */'yourColumn', /* columnName */0x24A40F6DFB05F379630AC0533E7F6357) /* iv */
AS DECRYPTED_VALUE
----------------
DECRYPTED_VALUE
yourCharValue
Direct Call to ing_e_chr_cl420 for Standard Encryption
SELECT dbo.ing_e_chr_cl420('yourCharValue', /* inputData */'yourKey', /* keyName */'CBC', /* Mode used */'PKCS5Padding', /* Padding used */0x4A40F6DFB05F379630AC0533E7F6357) /* iv */
AS ENCRYPTED_VALUE
----------------
ENCRYPTED_VALUE
0x9F71F06D9F1E123B68D910F0EC34E8C5
Direct Call to ing_d_chr_cl420 for Standard Encryption
SELECT dbo.ing_d_chr_cl420(0x9F71F06D9F1E123B68D910F0EC34E8C5,/* inputData */'yourKey', /* keyName */'CBC', /* Mode used */
'PKCS5Padding', /* Padding used */0x24A40F6DFB05F379630AC0533E7F6357) /* iv */
AS DECRYPTED_VALUE
----------------
DECRYPTED_VALUE
yourCharValue
Direct Call to ing_e_nvc_cl_fdb420 for FPE Encryption
SELECT dbo.ing_e_nvc_cl_fdb420
('112236276342649837947333444444444555555555555555555555564', /* inputData */'yourMetaDatabaseName', /* metadb */'yourKey', /* keyName */'FPE/CARD10', /* algorithm/cardinality used */'SHA1:12', /* Padding used */0x0401030003040604090301030705020505030507040108080102020704020702010304070400090105020603000002020906070004010200) /* iv */
AS ENCRYPTED_VALUE
----------------
ENCRYPTED_VALUE
141512473510550932344765206967565539602658354120603344918
Direct Call to ing_d_nvc_cl_fdb420 for FPE Encryption
SELECT dbo.ing_d_nvc_cl_fdb420('141512473510550932344765206967565539602658354120603344918', /* inputData */'yourMetaDatabaseName', /* metadb */'yourKey', /* keyName */'FPE/CARD10', /* algorithm/cardinality used */'SHA1:12', /* Padding used */0x0401030003040604090301030705020505030507040108080102020704020702010304070400090105020603000002020906070004010200) /* iv */
AS DECRYPTED_VALUE
----------------
DECRYPTED_VALUE
112236276342649837947333444444444555555555555555555555564
Direct Call to ing_e_vrc_fcl with FPE Encryption Formats
SELECT dbo.ing_e_vrc_fcl
('asdf1234!@#$1234', /* inputData */'yourKey', /* keyName */'FPE/CARD10', /* algorithm/cardinality used */'SHA256:LAST_FOUR', /* Padding used. Padding should be inTweakAlgo:TweakData/FpeEncFormat */0x0401030003040604090301030705020505030507040108080102020704020702010304070400090105020603000002020906070004010200) /* iv */
AS ENCRYPTED_VALUE
----------------
ENCRYPTED_VALUE
asdf3692!@#$1234
Direct Call to dbo.ing_d_vrc_fcl with FPE Encryption Formats
SELECT dbo.ing_d_nvc_cl_fdb420('asdf3692!@#$1234', /* inputData */'yourKey', /* keyName */'FPE/CARD10', /* algorithm/cardinality used */'SHA256:LAST_FOUR', /* Padding used. Padding should be in TweakAlgo:TweakData/FpeEncFormat */0x0401030003040604090301030705020505030507040108080102020704020702010304070400090105020603000002020906070004010200) /* iv */
AS DECRYPTED_VALUE
----------------
DECRYPTED_VALUE
asdf1234!@#$1234